23#include "moc_qgsplottoolpan.cpp"
44 mCanvas->panContentsBy( event->x() - mLastMousePos.x(), event->y() - mLastMousePos.y() );
45 mLastMousePos =
event->pos();
50 mMousePressStartPos =
event->pos();
52 if ( event->button() != Qt::LeftButton )
59 mLastMousePos =
event->pos();
60 mCanvas->viewport()->setCursor( Qt::ClosedHandCursor );
65 const bool clickOnly = !
isClickAndDrag( mMousePressStartPos, event->pos() );
67 if ( event->button() == Qt::MiddleButton && clickOnly )
70 mCanvas->centerPlotOn( event->pos().x(), event->pos().y() );
74 if ( !mIsPanning || event->button() != Qt::LeftButton )
81 canvas()->viewport()->setCursor( Qt::OpenHandCursor );
QFlags< PlotToolFlag > PlotToolFlags
@ ShowContextMenu
Show a context menu when right-clicking with the tool.
Plot canvas is a class for displaying interactive 2d charts and plots.
A mouse event which is the result of a user interaction with a QgsPlotCanvas.