Details
-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
5.5.0, 5.6.0, 5.7.0, 5.8.0, 5.9.0, 5.10.0
-
None
-
* Windows 10 64bit
* Qt 5.9.2 MSVC 2015 32 bit
* CPU 15-3470 && 8GB RAM
Description
Following code:
#include <QApplication> #include <QPlainTextEdit> #include <QTimer> static int counter = 0; int main(int argc, char *argv[]) { QApplication a(argc, argv); auto textEdit = new QPlainTextEdit; textEdit->setMaximumBlockCount(10); textEdit->show(); auto timer = new QTimer; QCoreApplication::connect(timer, &QTimer::timeout, [textEdit]() { textEdit->appendPlainText(QString::number(++counter)); }); timer->start(1); return a.exec(); }
takes very high ~30% for the CPU consumption.
Seems, something are not optimal in the widget's paint events and so on implementation. Is it normal?