Results 1 to 2 of 2

Thread: Direct QwtPlot painting

  1. #1
    Join Date
    Jan 2013
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Direct QwtPlot painting

    Hi, how can I achieve this:
    I have QwtPlot with axes and some functions (QwtPlotCurve) drawn on it.
    I want to draw a blue line from qwtplot center to its right top corner.
    I'd prefer to avoid computing canvas/logical coordinates - if possible.
    Waiting impatiently for solution ...

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

    Default Re: Direct QwtPlot painting

    Qt Code:
    1. class YourLine: public QwtPlotItem
    2. {
    3. public:
    4. ...
    5.  
    6. virtual void draw( QPainter *painter,
    7. const QwtScaleMap &, const QwtScaleMap &, const QRectF &canvasRect ) const
    8. {
    9. painter->setPen( Qt::blue );
    10. painter->drawLine( canvasRect.center(), canvasRect,topRight() );
    11. }
    12. };
    To copy to clipboard, switch view to plain text mode 

    Uwe

Similar Threads

  1. QSlider: direct jump
    By mpi in forum Qt Programming
    Replies: 2
    Last Post: 22nd July 2011, 07:02
  2. How to use a class who has SHAREDEXPORT in 'direct' mode?
    By tonnot in forum General Programming
    Replies: 9
    Last Post: 18th February 2011, 09:51
  3. Qt + WINAPI + direct painting
    By JovianGhost in forum Qt Programming
    Replies: 8
    Last Post: 26th March 2010, 05:10
  4. Qt and hardware direct rendering on Linux
    By Vogel Ubrhar in forum Qt Programming
    Replies: 0
    Last Post: 22nd March 2010, 08:58
  5. How to use Signal through direct connection
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2007, 07:07

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.