[Interest] QT4.8.0, Win7: QTextEdit (insertHtml) working too slowly.

mat //common mail mat.common at gmail.com
Mon Mar 12 12:39:18 CET 2012


Hi,

*OS:  Windows 7, 64 bit*
*SDK:  Qt_SDK_Win_offline_v1_2_en*
*Qt 4.8.0
*
*mingw*

*My experiment:*

void MainWindow::*SlotInsertLat*() // for insertLatBtn
{
  QTime timer; timer.start();
  *InsertText*( QString("Text text text text text text text text text text
text text.<br>") ); // Latin text (UTF-8)
  insertLatBtn->setText( QString("Insert Lat <<%1
msec>>").arg(timer.elapsed()) );
}

void MainWindow::*SlotInsertCyr*() // for insertCyrBtn
{
  QTime timer; timer.start();
  *InsertText*( QString("Текст текст текст текст текст текст текст текст
текст текст.<br>") ); // Cyrillic text (UTF-8)
  insertCyrBtn->setText( QString("Insert Cyr <<%1
msec>>").arg(timer.elapsed()) );
}

void MainWindow::*InsertText*(QString text)
{
  textEdit->textCursor().beginEditBlock();
  for(int r = 0; r < 300; r++)
  {
    textEdit->textCursor().insertHtml(text);
  }
  textEdit->textCursor().endEditBlock();
}

*Result (same exe + 4.7.4 or 4.8.0 Dll-s):*

*Qt 4.7.4*
300 rows, Latin text: 80 msec.
300 rows, Cyrillic text: 150  msec.

*Qt 4.8.0*
300 rows, Latin text: 200  msec.
300 rows, Cyrillic text: *1250  *msec. <------- !!! ???

Example code: http://www.fileden.com/files/2007/6/1/1132760/Linux/Text.7z
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120312/caf1936c/attachment.html>


More information about the Interest mailing list