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.
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.
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.
Perfect. Thanks.
Anything ... even I'm fighting with QT
Bookmarks