I found what caused the problem
When data change, I want my view to fit contents. So I have a MyPlot::resetZoom() method, which used to be like this :
void MyPlot
::resetZoom(const QRectF & rect
) {
p_zoomer->zoom(rect);
p_zoomer->setZoomBase(rect);
p_zoomer->zoom(0);
}
void MyPlot::resetZoom(const QRectF & rect)
{
p_zoomer->zoom(rect);
p_zoomer->setZoomBase(rect);
p_zoomer->zoom(0);
}
To copy to clipboard, switch view to plain text mode
and is called like this :
resetZoom(some_curve->boundingRect());
resetZoom(some_curve->boundingRect());
To copy to clipboard, switch view to plain text mode
But I never quite understood the zoomer behaviour, and what to call to setup zoom level properly.
I just changed my code to not use a QwtPlotZoomer anymore (but still a magnifier), and modified resetZoom() method :
void MyPlot::resetZoom()
{
setAxisAutoScale(xAxis(), true);
setAxisAutoScale(yAxis(), true);
replot();
}
void MyPlot::resetZoom()
{
setAxisAutoScale(xAxis(), true);
setAxisAutoScale(yAxis(), true);
replot();
}
To copy to clipboard, switch view to plain text mode
And it's ok now.
Some day I'll try to better understand all this stuff
Bookmarks