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

Harri Pasanen harri at mpaja.com
Mon Mar 12 13:24:18 CET 2012


Is your QTextEdit format rich text?

The reason I ask, is that I found that QML TextEdit was unusably slow
on Android (using Necessitas) if RichText was used.
It took like 10 seconds to display ~100 lines of text on Nexus One the first
time. Subsequent displays were fast. My guess was that font metrics lookups
are slow on android implementation, but the info is cached. But that is 
just a
guess. (On Symbian the same code was usable.)

Just curious,

Harri


On 03/12/2012 12:39 PM, mat //common mail wrote:
> 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
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list