42 mLastMousePos =
event->pos();
47 mMousePressStartPos =
event->pos();
49 if ( event->button() != Qt::LeftButton )
56 mLastMousePos =
event->pos();
57 mCanvas->viewport()->setCursor( Qt::ClosedHandCursor );
62 const bool clickOnly = !
isClickAndDrag( mMousePressStartPos, event->pos() );
64 if ( event->button() == Qt::MiddleButton && clickOnly )
71 if ( !mIsPanning || event->button() != Qt::LeftButton )
78 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.
virtual void panContentsBy(double dx, double dy)
Pans the plot contents by dx, dy in canvas units.
virtual void centerPlotOn(double x, double y)
Centers the plot on the plot point corresponding to x, y in canvas units.
A QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas.