Hi I am having a problem making my own QwtPlotCurve style. I want to make dotted lines like this post http://www.qtcentre.org/threads/2017...ht=dottedlines but I can't figure out how to call my new curve style.

My question is how do I actually call my style?

right now I put the built in curve styles into a list of styles like this

Qt Code:
  1. QwtPlotCurve::CurveStyle Styles[] = { QwtPlotCurve::Lines, QwtPlotCurve::Sticks, QwtPlotCurve::Steps, QwtPlotCurve::Dots};
  2. for( int i = 0; i < 4; i++)
  3. this->Styles[i] = Styles[i];
To copy to clipboard, switch view to plain text mode 

am I supposed to add QwtPlotCurve::UserCurve into that list, and if so how do I make sure it calls my reimplemented drawCurve? I think I am missing something basic.

Another idea that I had was to just call my class when I try to set the style

Qt Code:
  1. curve->setStyle(dotLines->DottedLines);
To copy to clipboard, switch view to plain text mode 

but I get the error 'QwtPlotCurve::setStyle' : cannot convert parameter 1 from 'DotLines::curveStyle' to 'QwtPlotCurve::CurveStyle'

which confuses me because my class DotLines inherits from QwtPlotCurve


Qt Code:
  1. class DotLines : public QwtPlotCurve{
  2. public:
  3.  
  4. enum curveStyle
  5. {
  6. DottedLines = QwtPlotCurve::UserCurve + 1000
  7. };
  8.  
  9.  
  10. virtual void drawCurve( QPainter * painter, int style, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const{
  11. if( style < QwtPlotCurve ::UserCurve )
  12. QwtPlotCurve::drawCurve(painter, style, xMap, yMap, canvasRect, from, to );
  13. }else{
  14. /// make dotted lines
  15. }
  16.  
  17. };
To copy to clipboard, switch view to plain text mode 


Any Ideas? Thanks