24#include <QApplication>
27#include "moc_qgsplottransienttools.cpp"
42 mLastMousePos =
event->pos();
47 if ( event->key() == Qt::Key_Space && !event->isAutoRepeat() )
55 mLastMousePos =
canvas()->mapFromGlobal( QCursor::pos() );
74 mLastMousePos =
event->pos();
79 if ( event->button() == Qt::MiddleButton )
87 mLastMousePos =
canvas()->mapFromGlobal( QCursor::pos() );
104 if ( !event->isAccepted() )
108 if ( mDeactivateOnMouseRelease )
114 if ( event->isAutoRepeat() )
121 if ( !( event->modifiers() & Qt::ControlModifier ) )
130 mDeactivateOnMouseRelease =
true;
137 updateCursor( event->modifiers() );
138 if ( event->key() == Qt::Key_Space )
140 mDeactivateOnMouseRelease =
false;
147 if ( event->isAutoRepeat() )
153 if ( event->key() == Qt::Key_Space )
163 mDeactivateOnMouseRelease =
true;
168 updateCursor( event->modifiers() );
175 mDeactivateOnMouseRelease =
false;
178 updateCursor( QApplication::keyboardModifiers() );
181void QgsPlotToolTemporaryKeyZoom::updateCursor( Qt::KeyboardModifiers modifiers )
static QCursor getThemeCursor(Cursor cursor)
Helper to get a theme cursor.
Plot canvas is a class for displaying interactive 2d charts and plots.
void setTool(QgsPlotTool *tool)
Sets the interactive tool currently being used on the canvas.
virtual void panContentsBy(double dx, double dy)
Pans the plot contents by dx, dy in canvas units.
QgsPlotTool * tool()
Returns the currently active tool.
A mouse event which is the result of a user interaction with a QgsPlotCanvas.