PDA

View Full Version : How to display text from the picker only during a click



sadastronaut
5th August 2014, 20:52
I have a QwtPlotPicker object, initialized with a QwtPickerClickPointMachine.

QwtPlotPicker * picker = new QwtPlotPicker(ui->qwt_plot->canvas());
picker->setStateMachine(new QwtPickerClickPointMachine);
picker->setTrackerMode(QwtPicker::ActiveOnly);
I want the text of the picker to only display during a right-click, and I'm not sure how to do this. I set the trackerMode to ActiveOnly, but I don't know how to make the picker "active". This makes sense with dragging a rectangle or line, but not intuitively with a single-click. Is this possible, or do I need to use a different type of state machine?

Uwe
6th August 2014, 10:07
picker->setTrackerMode( QwtPicker::ActiveOnly );
picker->setStateMachine( new QwtPickerDragPointMachine() );
picker->setMousePattern( QwtEventPattern::MouseSelect1, Qt::RightButton );Uwe