Results 1 to 7 of 7

Thread: [UNSOLVED]QPlainTextEdit / QTextEdit performance issues using set or append methods

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default [UNSOLVED]QPlainTextEdit / QTextEdit performance issues using set or append methods

    Gd day,

    I have read recently a topic named "QPlainTextEdit performance in Qt 4.7.0", as topic itself referred only to Qt 4.7.0 I started this one.

    We can see that author wrote
    Quote Originally Posted by Carlsberg View Post
    ...I've narrowed down by comenting stuff in my update method and it all comes to this
    Qt Code:
    1. m_viewport->setPlainText(dataBuffer);
    To copy to clipboard, switch view to plain text mode 
    After that we can read that author himself "solved" the problem.
    Quote Originally Posted by Carlsberg View Post
    Happens the same on 4.7.2. So, compiled with 4.5.1 it's lighting fast, compiled with 4.7.0 and 4.7.2 it's amazingly slow
    My case:
    Qt Code:
    1. this->appendPlainText(finalLogContents);
    To copy to clipboard, switch view to plain text mode 
    Used as recommended in documentation with
    Qt Code:
    1. setMaximumBlockCount = 80;
    To copy to clipboard, switch view to plain text mode 
    works the same as
    Qt Code:
    1. this->setPlainText(finalLogContents);
    To copy to clipboard, switch view to plain text mode 
    Text in my QPlainTextEdit is refreshed every scroll made using either
    Qt Code:
    1. QScrollBar or WheelEvent or PageDown
    To copy to clipboard, switch view to plain text mode 
    - every time call to
    Qt Code:
    1. setPlainText()
    To copy to clipboard, switch view to plain text mode 
    consumes about 40% of 2.6 GHz CPU - it is way too much. Everytime variable named
    Qt Code:
    1. finalLogContents
    To copy to clipboard, switch view to plain text mode 
    consist of 80-100 lines depending on screen resolution.
    I am thinking that maybe textChanged() SIGNAL is causing trouble - I will check it in a while with blockSignals().

    Question:
    Is there a method which use
    Qt Code:
    1. char *
    To copy to clipboard, switch view to plain text mode 
    instead of QString(I think it will be way faster cause I store all my data in
    Qt Code:
    To copy to clipboard, switch view to plain text mode 
    Should I revert to 4.5.1 or reimplement all crucial methods and create own fully customized TextEdit or maybe find another way using native QPlainTextEdit?

    Thank you in advance, please post any even strange idea!

    Edit 1:
    Unfortunately textChanged SIGNAL is not causing my problem since it is not connected to any slot thus blocking it with QObject::blockSignals() gives nothing.
    Last edited by MW; 27th July 2012 at 19:54.

Similar Threads

  1. QPlainTextEdit performance in Qt 4.7.0
    By Carlsberg in forum Qt Programming
    Replies: 1
    Last Post: 3rd March 2011, 08:57
  2. PyQt4 - QPlainTextEdit: performance when hidding blocks
    By josemaria.alkala in forum Newbie
    Replies: 6
    Last Post: 27th June 2010, 14:58
  3. QTextEdit doesn't append text
    By Luc4 in forum Qt Programming
    Replies: 7
    Last Post: 13th June 2010, 22:45
  4. margins in QTextEdit/QPlainTextEdit
    By corrado in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2010, 09:35
  5. QTextEdit::append help
    By tho97 in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2007, 07:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.