First Click of a QwtPlotPicker does not respond
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:
// 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)));
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
Re: First Click of a QwtPlotPicker does not respond
An update: I have found that the use of a QwtPlotPanner is the root cause, however, I cannot figure out why this is causing the first mouse click to not be recognized.
Added after 26 minutes:
I believe I have resolved this problem, however, I am not sure I understand why this resolution works:
I am using a QwtPlotPanner and a QwtPlotPicker. If the QwtPlotPicker is initialized BEFORE the QwtPlotPanner, the very first mouse click on the QwtPlot is ignored. I have modified my code to initialize the QwtPlotPanner before the Picker. With this change, things do seem to be working as expected. If there is anyone that explain to me why this is so, I would appreciate it.
V/R
--jbob
Re: First Click of a QwtPlotPicker does not respond
Have a look on setMousePattern methods (default behavior) for both Panner and Picker objects to see if you don't have conflicts.