[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Qt question: fast text logging widget
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2004-07-28 16:51:12
Message-ID: 200407281851.13169.neundorf () kde ! org
[Download RAW message or body]

Hi,

what is the best way to put a lot of incoming text as fast as possible in a 
widget ?
Currently I'm using QTextBrowser::insert() with Plain textformat
Small problems: I have to take care that the "cursor" is always at the end of 
the QTextBrowser
-each inserted line is its own paragraph

QTextBrowser::append() seems to have the effect that every appended text (also 
if it doesn't contain a line break) becomes its own paragraph on its own 
line. This sucks.

I guess collecting the text in a QString and then using setText() every time 
something is appended to the string is too slow (the string maybe very long, 
like 10k and more, and several times per second 10 to 20 chars are appended)

Another problem: what's the best way to remove text from the beginning ?
Currently I'm selecting the first 100 paragraphs and delete them, with updates 
disabled. Works reasonably well. Any better ideas ?

Bye
Alex
-- 
Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de
Home: neundorf@kde.org                - http://www.kde.org
      alex@neundorf.net               - http://www.neundorf.net
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic