Results 1 to 4 of 4

Thread: How use QwtPainter?

  1. #1
    Join Date
    Dec 2015
    Posts
    5
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Angry How use QwtPainter?

    I want to draw an auxiliary line on the QwtPlot. The line should connect two points. I don't want use the QwtPlotCurve to achieve the goal. The class QwtPainter contains function drawLine, but I don't understand how to use this.

    How to draw a line on the QwtPlot?

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

    Default Re: How use QwtPainter?

    You can't just draw - you have to do it inside the draw method of an item, or inside the paint event of the canvas. ( for stuff like rubberbands, cursors you would also have the option to use a widget overlay, but this more advanced stuff ).

    What about simply using a QwtPlotShapeItem - a line can easily be expressed as QPainterPath ?

    Uwe
    Last edited by Uwe; 9th December 2015 at 14:02.

  3. The following user says thank you to Uwe for this useful post:

    d1mbarus (15th December 2015)

  4. #3
    Join Date
    Dec 2015
    Posts
    5
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How use QwtPainter?

    This is a good alternative solution. Thank you!

  5. #4
    Join Date
    Dec 2015
    Posts
    5
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

Similar Threads

  1. QwtPainter DrawRect
    By BettaUseYoNikes in forum Qwt
    Replies: 2
    Last Post: 22nd August 2011, 21:26
  2. Threads and QwtPainter::drawText
    By AwDogsgo2Heaven in forum Qwt
    Replies: 1
    Last Post: 15th July 2009, 17:45

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.