Setting brush and baseline to your curve is almost what you need - beside clipping away the rectangle above your baseline before the curve is filled. But unfortunately QwtPlotCurve::fillCurve() is not virtual.

So what you try do is something like this:

Qt Code:
  1. virtual void YourCurve::drawLines(QPainter *painter,
  2. const QwtScaleMap &xMap, const QwtScaleMap &yMap,
  3. int from, int to) const
  4. {
  5. painter->save();
  6.  
  7. painter->setClipRect(...);
  8.  
  9. const QPen pen = this->pen();
  10. setPen(Qt::transparent);
  11.  
  12. QwtPlotCurve::drawLines(painter, xMap, yMap, from, to);
  13.  
  14. setPen(pen);
  15.  
  16. painter->restore();
  17.  
  18. const QBrush brush = this->brush();
  19. setBrush(Qt::NoBrush);
  20.  
  21. QwtPlotCurve::drawLines(painter, xMap, yMap, from, to);
  22.  
  23. setBrush(brush);
  24. }
To copy to clipboard, switch view to plain text mode 

Uwe