from/to are indexes no coordinates !
Guess what you want to do is to overload QwtPlotCurve::drawLines(), where you split your index intervals according to your coordinates. As your points are ordered by time are you can use qwtUpperSampleIndex() to calculate the indexes corresponding to your time intervals.
Something like this:
{
public:
virtual void drawLines
( QPainter *painter,
const QRectF &canvasRect,
int from,
int to
) const {
for_all_your_intervals()
{
int idx1 = indexOf( interval.min() );
int idx2 = indexOf( interval.max() );
painter->setPen( ... );
QwtPlotCurve::drawLines( painter, xMap, yMap, canvasRect, idx1 idx2
);
}
};
class YourCurve: public QwtPlotCurve
{
public:
virtual void drawLines( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int from, int to ) const
{
for_all_your_intervals()
{
int idx1 = indexOf( interval.min() );
int idx2 = indexOf( interval.max() );
painter->setPen( ... );
QwtPlotCurve::drawLines( painter, xMap, yMap, canvasRect, idx1 idx2 );
}
};
To copy to clipboard, switch view to plain text mode
Uwe
Bookmarks