You need to implement a navigation history, where you have all zoomer and panner operations. One solution is to forward the rectangles of your panner into the zoom stack. Something like this:
virtual void YourPanner::moveCanvas(int dx, int dy)
{
QStack<QwtDoubleRect> &zoomStack =
const_cast< QStack<QwtDoubleRect> >zoomer->zoomStack();
zoomStack.push(zoomer->scaleRect());
zoomer->zoom(1);
}
virtual void YourPanner::moveCanvas(int dx, int dy)
{
QwtPlotPanner::moveCanvas(dx, dy);
QStack<QwtDoubleRect> &zoomStack =
const_cast< QStack<QwtDoubleRect> >zoomer->zoomStack();
zoomStack.push(zoomer->scaleRect());
zoomer->zoom(1);
}
To copy to clipboard, switch view to plain text mode
Of course this is only a workaround for a design problem of Qwt, that should better organize the navigation history inside the plot widget.
Uwe
Bookmarks