Details
-
Suggestion
-
Resolution: Out of scope
-
P4: Low
-
Some future release
-
None
Description
It would be nice if QTextDocument::setHtml() was faster.
For large html documents the function takes a long time to complete.
Consider the following example,
These are the times it takes for the setHtml() to complete when the for-loop has run to make a html string:
500 times -> 2 seconds
1000 times -> 5 seconds
2000 time -> 23 seconds
9000 times -> 497 seconds
#include <QtGui>
#include <QDebug>
#include <QTime>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QString html = "";
for (int a=0; a < 1000; a++)
QTime time;
QTextEdit tedit;
tedit.show();
time.start();
tedit.setHtml(html);
qDebug() << time.elapsed();
return app.exec();
}