PDA

View Full Version : plotting curve with dashed lines alternating colors



corrado1972
29th April 2011, 10:18
Should be possible to draw a curve using dashed lines with different alternate colors?
I want to draw a curve using red,white,yellow and repeating the pattern.

I'm looking to QwtPlotCurve::setPen but seems it is a topic related to QT properly.
Is there a way to derive QwtPlotCurve (http://qwt.sourceforge.net/class_qwt_plot_curve.html) and reimplement draw methods?

Uwe
29th April 2011, 12:26
Is there a way to derive QwtPlotCurve (http://qwt.sourceforge.net/class_qwt_plot_curve.html) and reimplement draw methods?
Yes - the solution is to derive from QwtPlotCurve and to reimplement draw methods. :rolleyes:

Ok, more serious:

Reimplement YourCurve::drawCurve call QwtPlotCurve::drawLines for each curve segment with a different pen assigned to the painter.

Uwe