Hi all,
I try to fill the curve below and over the baseline with different color. I try to use the code that I found here and for clipping different regions it's ok.
But I'm not been able to fill it with different color could someone help me. I try with setBrush(...) but nothing happen.
Thanks miky.

Qt Code:
  1. void Curve::fillCurve(QPainter *painter,
  2. const QwtScaleMap &xMap, const QwtScaleMap &yMap,
  3. const QRectF & canvasRect, QPolygonF & polygon) const
  4. {
  5. painter->save();
  6. QBrush *brush1 = new QBrush (Qt::green, Qt::SolidPattern);
  7. painter->setBrush(*brush1);
  8. painter->setClipRect(0,yMap.transform(baseline()),1000,1000,
  9. Qt::ReplaceClip);
  10. // QwtPlotCurve::fillCurve(painter, xMap, yMap, canvasRect, polygon);
  11.  
  12. painter->setClipRect(0,0,1000,yMap.transform(baseline()),
  13. Qt::ReplaceClip);
  14. QwtPlotCurve::fillCurve(painter, xMap, yMap, canvasRect, polygon);
  15. painter->restore();
  16.  
  17. }
To copy to clipboard, switch view to plain text mode