Results 1 to 4 of 4

Thread: display data for plot items on QwtPolarPlot with mouse hover

  1. #1
    Join Date
    Apr 2016
    Posts
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default display data for plot items on QwtPolarPlot with mouse hover

    I want to place shapes on a QwtPolarPlot. When the user hovers the mouse on an item, I want to display that item's azimuth and radius. Can someone point me in the right direction for this? An example would be great.

  2. #2
    Join Date
    Mar 2016
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: display data for plot items on QwtPolarPlot with mouse hover

    You can use the QwtPiker , so by right-clicking you can obtain the value


    Added after 7 minutes:


    Example:

    class MyPicker: public QwtPolarPicker
    {
    public:
    MyPicker( QwtPolarCanvas *canvas ):
    QwtPolarPicker( canvas )
    {
    setStateMachine( new QwtPickerDragPointMachine() );
    setRubberBand( QwtPicker::NoRubberBand );
    setTrackerMode( ActiveOnly );
    }

    virtual QwtText trackerTextPolar( const QwtPointPolar &pos ) const
    {
    QColor bg( Qt::white );
    bg.setAlpha( 200 );

    ..........................
    .......................
    .....................
    QwtText text = QwtPolarPicker::trackerTextPolar( pos );

    text.setBackgroundBrush( QBrush( bg ) );
    return text;
    }
    };

    where the dots .................. you can possibly perform a processing on your current location.

    picker = new MyPicker( ui->myqwtPolarPlot->canvas() );
    picker->setMousePattern( QwtEventPattern::MouseSelect1, Qt::RightButton );
    Last edited by stepner03; 14th April 2016 at 19:44.

  3. #3
    Join Date
    Apr 2016
    Posts
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: display data for plot items on QwtPolarPlot with mouse hover

    Perfect. Thanks.

  4. #4
    Join Date
    Mar 2016
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: display data for plot items on QwtPolarPlot with mouse hover

    Anything ... even I'm fighting with QT

Similar Threads

  1. Replies: 6
    Last Post: 12th August 2013, 18:13
  2. Replies: 3
    Last Post: 15th March 2013, 10:45
  3. Creating a Tooltip-like widget for mouse-hover of QListView items
    By TropicalPenguin in forum Qt Programming
    Replies: 4
    Last Post: 26th November 2011, 05:14
  4. Show text on mouse hover on plot
    By pkj in forum Qwt
    Replies: 1
    Last Post: 25th February 2011, 07:36
  5. Replies: 5
    Last Post: 27th November 2009, 13:57

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.