Hi,

i subclassed QwtPlotCurve to add new functions that we need.
One point is adding QwtPlotMarker into plot that belong to the curve and
will be attached, detached, setVisible together with the curve. Is all working.

But if some one change the color of the curve, all QwtPlotMarker should change
the color also. The marker has a custom symbol and if i try to set the brush color
o got this error:

passing 'const QwtSymbol' as 'this' argument of void::QwtSymbol::setBrush(const QBrush&) discards qualifiers

What i'm doing wrong?

Qt Code:
  1. curve->setPen(color,2.0); // change curve color
  2. curve->setMarkerColor( color ) // change marker color
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. // in class PlotCurve::PrivateData
  2. QList<QwtPlotMarker *> qlMarkerError1;
  3.  
  4.  
  5. void PlotCurve::setMarkerColor( QColor color ) const
  6. {
  7. foreach (QwtPlotMarker *marker, d_data->qlMarkerError1)
  8. {
  9. QBrush brush = marker->symbol()->brush();
  10. brush.setColor( color );
  11. marker->symbol()->setBrush( brush ); // ERROR LINE
  12. }
  13. }
To copy to clipboard, switch view to plain text mode