[Qt-interest] Faster logfile viewer
Arnold Krille
arnold at arnoldarts.de
Wed Aug 5 15:16:01 CEST 2009
On Wednesday 05 August 2009 00:57:45 Christoph Bartoschek wrote:
> unfortunately using update() does not work. I have to explain the
> application a little bit more:
> It's a VLSI-application that executes operations that take several hours of
> runtime during which the GUI is effectively blocked. There is only the
> TextEdit with the logfile where the operations write status information to.
> Normally this works fine but sometimes the operations want to write more
> than 100000 lines in a very short time.
> The resulting requirements are:
> - Because one does not know when the next line has to be shown one cannot
> merge several lines together and has to show each one separately.
> - Because each line can be the last one for a longer time the widget has to
> be updated after each line.
Here is what I think:
1) Use threads to decouple gui and the work. There is really no good reason to
have the gui blocked for more then some fractions of a second. Otherwise the
users get confused.
2) When you have done #1 and use update() instead of repaint() the event-queue
of qt will automaticly combine multiple paintEvents into one. So when just one
line is appended, the gui is updated rather fast, when a lot of lines are
appended in rapid succession, the repaint happens only a few times or maybe
even only one time.
> Our old GUI uses Motif and also colored lines. The updates are also after
> each line but writing 10000 lines takes less than one second.
Somehow I have the feeling that Motif is not really doing 10000 paint-events
for that but combines them instead...
Have fun,
Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090805/50ad5de9/attachment.bin
More information about the Qt-interest-old
mailing list