19#include "moc_qgsplottransienttools.cpp"
25#include <QApplication>
40 event->y() - mLastMousePos.y() );
41 mLastMousePos =
event->pos();
46 if ( event->key() == Qt::Key_Space && !event->isAutoRepeat() )
54 mLastMousePos =
canvas()->mapFromGlobal( QCursor::pos() );
73 event->y() - mLastMousePos.y() );
74 mLastMousePos =
event->pos();
79 if ( event->button() == Qt::MiddleButton )
87 mLastMousePos =
canvas()->mapFromGlobal( QCursor::pos() );
105 if ( !event->isAccepted() )
109 if ( mDeactivateOnMouseRelease )
115 if ( event->isAutoRepeat() )
122 if ( !( event->modifiers() & Qt::ControlModifier ) )
131 mDeactivateOnMouseRelease =
true;
138 updateCursor( event->modifiers() );
139 if ( event->key() == Qt::Key_Space )
141 mDeactivateOnMouseRelease =
false;
148 if ( event->isAutoRepeat() )
154 if ( event->key() == Qt::Key_Space )
164 mDeactivateOnMouseRelease =
true;
169 updateCursor( event->modifiers() );
176 mDeactivateOnMouseRelease =
false;
179 updateCursor( QApplication::keyboardModifiers() );
182void QgsPlotToolTemporaryKeyZoom::updateCursor( Qt::KeyboardModifiers modifiers )
184 canvas()->viewport()->setCursor( ( modifiers & Qt::AltModifier ) ?
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.