[Qt-interest] real time strip chart
André Somers
andre at familiesomers.nl
Fri May 20 20:14:41 CEST 2011
You could try to force the use of the raster or open gl graphics systems.
André
Verstuurd vanaf mijn iPhone
Op 20 mei 2011 om 18:06 heeft giovanni drogo <gvnndrogo at googlemail.com> het volgende geschreven:
> 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
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110520/7de92ddd/attachment.html
More information about the Qt-interest-old
mailing list