19#include "moc_qgsplottransienttools.cpp"
25#include <QApplication>
40 mLastMousePos =
event->pos();
45 if ( event->key() == Qt::Key_Space && !event->isAutoRepeat() )
53 mLastMousePos =
canvas()->mapFromGlobal( QCursor::pos() );
72 mLastMousePos =
event->pos();
77 if ( event->button() == Qt::MiddleButton )
85 mLastMousePos =
canvas()->mapFromGlobal( QCursor::pos() );
103 if ( !event->isAccepted() )
107 if ( mDeactivateOnMouseRelease )
113 if ( event->isAutoRepeat() )
120 if ( !( event->modifiers() & Qt::ControlModifier ) )
129 mDeactivateOnMouseRelease =
true;
136 updateCursor( event->modifiers() );
137 if ( event->key() == Qt::Key_Space )
139 mDeactivateOnMouseRelease =
false;
146 if ( event->isAutoRepeat() )
152 if ( event->key() == Qt::Key_Space )
162 mDeactivateOnMouseRelease =
true;
167 updateCursor( event->modifiers() );
174 mDeactivateOnMouseRelease =
false;
177 updateCursor( QApplication::keyboardModifiers() );
180void QgsPlotToolTemporaryKeyZoom::updateCursor( Qt::KeyboardModifiers modifiers )
Extends QApplication to provide access to QGIS specific resources such as theme paths,...
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 QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas.