21#include <QApplication>
31 if ( !event->isAccepted() )
35 if ( mDeactivateOnMouseRelease )
36 view()->setTool( mPreviousViewTool );
41 if ( event->isAutoRepeat() )
48 if ( !( event->modifiers() & Qt::ControlModifier ) )
53 view()->setTool( mPreviousViewTool );
57 mDeactivateOnMouseRelease =
true;
64 updateCursor( event->modifiers() );
65 if ( event->key() == Qt::Key_Space )
67 mDeactivateOnMouseRelease =
false;
74 if ( event->isAutoRepeat() )
80 if ( event->key() == Qt::Key_Space )
86 view()->setTool( mPreviousViewTool );
90 mDeactivateOnMouseRelease =
true;
95 updateCursor( event->modifiers() );
102 mDeactivateOnMouseRelease =
false;
103 mPreviousViewTool =
view()->tool();
105 updateCursor( QApplication::keyboardModifiers() );
108void QgsModelViewToolTemporaryKeyZoom::updateCursor( Qt::KeyboardModifiers modifiers )
110 view()->viewport()->setCursor( ( modifiers & Qt::AltModifier ) ?
static QCursor getThemeCursor(Cursor cursor)
Helper to get a theme cursor.
A QgsModelViewMouseEvent is the result of a user interaction with the mouse on a QgsModelGraphicsView...