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
Originally Posted by
Carlsberg
...I've narrowed down by comenting stuff in my update method and it all comes to this
m_viewport->setPlainText(dataBuffer);
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.
Originally Posted by
Carlsberg
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:
this->appendPlainText(finalLogContents);
this->appendPlainText(finalLogContents);
To copy to clipboard, switch view to plain text mode
Used as recommended in documentation with
setMaximumBlockCount = 80;
setMaximumBlockCount = 80;
To copy to clipboard, switch view to plain text mode
works the same as
this->setPlainText(finalLogContents);
this->setPlainText(finalLogContents);
To copy to clipboard, switch view to plain text mode
Text in my QPlainTextEdit is refreshed every scroll made using either
QScrollBar or WheelEvent or PageDown
To copy to clipboard, switch view to plain text mode
- every time call to
setPlainText()
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
finalLogContents
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
char *
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
QByteArray
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.
Bookmarks