Results 1 to 8 of 8

Thread: Curve seem not so clear when seBrush ?

  1. #1
    Join Date
    Jul 2013
    Posts
    72
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Curve seem not so clear when seBrush ?

    When curve is setBrush , sections of the curve miss. The curve is not clear as before . Does anyone know how to solve this problem ?
    Thanks


    curve.jpg

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Curve seem not so clear when seBrush ?

    What is missing?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2013
    Posts
    72
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Curve seem not so clear when seBrush ?

    Not missing , but it seems the part of the curve is covered by the brush area

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Curve seem not so clear when seBrush ?

    Is it visible on your screenshot?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jul 2013
    Posts
    72
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Curve seem not so clear when seBrush ?

    I can see some red . If the curve is set Width larger, I can see the whole curve. But it is thinner than others ,and many points in the curve on the brush side.


    curve3.jpg

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Curve seem not so clear when seBrush ?

    I'm sorry, I don't understand what you mean.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Curve seem not so clear when seBrush ?

    Quote Originally Posted by lwz View Post
    But it is thinner than others ,and many points in the curve on the brush side.
    The reason for this effect is obvious when looking at the implementation of QwtPlotCurve::drawLines: it draws the curve lines first before drawing the fill area in a second run. Interestingly this always been like this.

    The code below inverts this drawing order, but be aware that it is not a complete replacement for all what needs to be done inside of QwtPlotCurve::drawLines. A fix that qualifies to be added to SVN has to take care of more use cases and of course should try to avoid wasting memory for having 2 temporary polygons for all points at the same time.

    Uwe

    Qt Code:
    1. class Curve: public QwtPlotCurve
    2. {
    3. public:
    4. Curve( const QString& title ):
    5. QwtPlotCurve( title )
    6. {
    7. }
    8.  
    9. protected:
    10. virtual void drawLines( QPainter *painter,
    11. const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    12. const QRectF &canvasRect, int from, int to ) const
    13. {
    14. QwtPointMapper mapper;
    15. mapper.setBoundingRect( canvasRect );
    16.  
    17. QPolygonF polyline = mapper.toPolygonF( xMap, yMap, data(), from, to );
    18.  
    19. QPolygonF outline = polyline;
    20. fillCurve( painter, xMap, yMap, canvasRect, outline );
    21. QwtPainter::drawPolyline( painter, polyline );
    22. }
    23. };
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Jul 2013
    Posts
    72
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Curve seem not so clear when seBrush ?

    oh,I see, thanks

Similar Threads

  1. clear all QLineEdit
    By jaca in forum Qt Programming
    Replies: 7
    Last Post: 5th August 2016, 07:06
  2. Replies: 1
    Last Post: 31st October 2011, 14:23
  3. Replies: 2
    Last Post: 23rd August 2011, 12:23
  4. Replies: 4
    Last Post: 29th April 2010, 06:11
  5. Replies: 1
    Last Post: 22nd January 2010, 14:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.