I agree it seems complicated, but customer has requested the double-click zoom out capability because their users are so familiar with current Matlab plot functionality.
I am already using a zoomer that I pulled and modified slightly from one of the examples:
// LeftButton for the zooming
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RightButton: zoom out to full size
zoomer
->setRubberBandPen
(QColor(Qt
::red));
zoomer
->setTrackerPen
(QColor(Qt
::red));
Qt::RightButton, Qt::ControlModifier);
Qt::RightButton);
// LeftButton for the zooming
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RightButton: zoom out to full size
QwtPlotZoomer* zoomer = new QwtPlotZoomer(canvas());
zoomer->setRubberBandPen(QColor(Qt::red));
zoomer->setTrackerPen(QColor(Qt::red));
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
Qt::RightButton);
To copy to clipboard, switch view to plain text mode
Now I'm trying to somehow 'capture' a Qt::LeftButton double-click which will then use zoom(0) as you mention.
Bookmarks