// panning with the left mouse button
(void )new QwtPlotPanner( canvas() );
// zoom in/out with the wheel
QwtPlotMagnifier *magnifier = new QwtPlotMagnifier( canvas() );//图形的整体缩放
magnifier->setMouseButton( Qt::NoButton );
// LeftButton for the zooming
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size
QwtPlotZoomer* zoomer = new QwtPlotZoomer( canvas ); //选择图形局部放大
zoomer->setRubberBandPen( QColor( Qt::red ) );
zoomer->setTrackerPen( QColor( Qt::yellow ) );
zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier );
zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
Qt::RightButton );