Don't use a picker here - it's a QObject, that needs event processing - something, that is not happening the way you wrote your code.
Instead do something like this:
{
const double x
= canvasMap
( QwtPlot::xBottom ).
invTransform( mousePoint.
x() );
const double y
= canvasMap
( QwtPlot::yLeft ).
invTransform( mousePoint.
y() );
...
}
QPointF myCurveWidget::mapMousePoint(QPoint mousePoint)
{
const double x = canvasMap( QwtPlot::xBottom ).invTransform( mousePoint.x() );
const double y = canvasMap( QwtPlot::yLeft ).invTransform( mousePoint.y() );
...
}
To copy to clipboard, switch view to plain text mode
I'm not 100% sure if this already solves your problem, but at least it's better than using a picker and it should be easier to find out what is going on. If the bug is still there you should check p1, p2, s1, s2 of the maps to see if there are pending updates of the scales because of a missing replot.
Uwe
Bookmarks