View Full Version : Adding points to a plot without forcing a redraw

1st October 2008, 22:32
I read through the documentation and through the forum and couldn't find anything covering what I am trying to do but I assume it really shouldn't be as hard as I am making it out to be.

Jists of what I am doing:

Reading in a file of points and placing a QwtSymbol::Cross at each point. The rendering is being done while reading in the file.

Issue that is occuring:

When I go to draw a new QwtSymbol::Cross to the screen it is going back and redrawing every point not just the newest point. I tried "setPaintAttribute(QwtPlotCurve::PaintFiltered);" in hopes to see if that would help in any form of performance. I have overridden the "QwtPlotCurve::draw" and placed all my drawing routines between "painter->save()" and "painter->restore()" in order to try and increase performance but I still haven't found a way to simply only draw the newest points. When I specifically state to only draw the newest points it clears all other points from the screen. Hoping that I am just looking over a quick and easy method to implement this.

Let me know if you need any more information from me and I will try and give what I can. Thanks for reading this over.


2nd October 2008, 07:29
You are looking for QwtPlotCurve::draw(int from, int to). The realtime example shows an use case similar to yours

But note that with Qt4 the performance of incremental painting depends on the capabilities of your environment. Only when Qt::WA_PaintOutsidePaintEvent is supported it works as effective as with Qt3.