Hi fellow coders:
I am working on a bit of code where I need to find the coordinates of a mouse click on a QwtPlot object. Everything works fine except the very first mouse click is ignored. Here is the initialization code:
// code snippet ---------------------------------------------------------------------------------
picker
= new QwtPlotPicker(btrElement
->btrStructure.
btr->canvas
());
picker->setEnabled(true);
picker
->setTrackerPen
(QColor(Qt
::white));
picker
->setRubberBand
(QwtPicker::RectRubberBand);
connect(picker,
this,
SLOT(rcvBTRPointSelected
(QPointF)));
// code snippet ---------------------------------------------------------------------------------
picker = new QwtPlotPicker(btrElement->btrStructure.btr->canvas());
picker->setEnabled(true);
picker->setTrackerPen(QColor(Qt::white));
picker->setTrackerMode(QwtPlotPicker::AlwaysOn);
picker->setStateMachine(new QwtPickerClickPointMachine());
picker->setRubberBand(QwtPicker::RectRubberBand);
connect(picker,
SIGNAL(selected(QPointF)),
this,
SLOT(rcvBTRPointSelected(QPointF)));
To copy to clipboard, switch view to plain text mode
I would expect that once I click on the QwtPlot object, it would immediately respond to the click via the SLOT/SIGNAL mechanisms that Qt uses. This does happen after the initial click.
As another note: I am using 5 of these plots and each exhibits the very same behavior.
Any help would be greatly appreciated. Thanks.
-jbob
Bookmarks