PDA

View Full Version : Multiple curves paint most recent on top



jmsbc
29th July 2009, 18:26
Hi,

I have two curves that get populated with an almost identical set of data (just shifted a bit from each other and with different colors). My problem is that I need to paint the most recent data from each curve on top of all the other old data.

Is there any way to do this?

Thank you,
-James

jmsbc
30th July 2009, 21:46
By the way, I tried setting Z-values of both curves equal to each other, but that didn't work. Do i have to make a user-defined QwtPlotItem that consists of both QwtPlotCurves?

Thanks

Uwe
1st August 2009, 11:44
Plot items are painted in order of their z values. The points of a curve are painted in increasing order according to the point index.
If you want to change this you can overload QwtPlot::drawItems and paint your curves in several parts using:


void QwtPlotCurve::draw(QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
int from, int to) const
Uwe