Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. qwt, how to fill area above a curve with color?

qwt, how to fill area above a curve with color?

Scheduled Pinned Locked Moved 3rd Party Software
1 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ConfaMiky
    wrote on last edited by
    #1

    Hi all,
    Colud aomeone help in qwt fillCurve using?
    I try to fill the curve below and over the baseline with different color. I try to use the code that I found 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.

    @
    void Curve::fillCurve(QPainter *painter,
    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    const QRectF & canvasRect, QPolygonF & polygon) const
    {
    painter->save();
    QBrush *brush1 = new QBrush (Qt::green, Qt::SolidPattern);
    setBrush(*brush1);
    painter->setClipRect(0,yMap.transform(baseline()),1000,1000,
    Qt::ReplaceClip);
    // QwtPlotCurve::fillCurve(painter, xMap, yMap, canvasRect, polygon);

    painter->setClipRect(0,0,1000,yMap.transform(baseline()),
                         Qt::ReplaceClip);
    QwtPlotCurve::fillCurve(painter, xMap, yMap, canvasRect, polygon);
    painter->restore();
    

    }@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved