[Qt-interest] real time strip chart
giovanni drogo
gvnndrogo at googlemail.com
Fri May 20 18:06:10 CEST 2011
Hi All,
I'm developing a QT application which includes a real time chart (with
several (8 or more) traces), similar to an ECG monitor. Traces should move
on the monitor with a speed of about 5cm/sec. The active window is, in
principle almost the whole screen. Target operating system is Linux.
Do somebody has some suggestion about the best approach?
I try to look in the archive, but all the messages I found are now too old.
The approach I'm taking now is the following:
I have a timer, clocking at about 50Hz. When the timer expires I compute the
scrolling amount using the effective elapsed time, and I scroll the widget
using the QWidget::scroll() function. Then I paint the traces in the empty
space.
The algorithm is fine, but visual aspect is very bad. Traces run very
unsmooth, unless the widget is made very small.
After some profiling I found that the QT program run quite fast: it takes
only few milliseconds to scroll the widget and to paint the traces, however
the X server is *really* busy. My impression is that, at the end of my
PaintEvent, Qt simply tell X to repaint the whole widget, and this is
clearly too much.
Before that I tried the classical canvas approach, scrolling and painting a
QImage or a Qpixmaps, and drawing them to the widget. Results are even
worst: computer and X server are so busy that timer event are lost!
Any suggestion?
Thanks in advance,
G. Drogo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110520/e2fba547/attachment.html
More information about the Qt-interest-old
mailing list