mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[API] Expose mouse wheel to map tools as QgsMapTool::wheelEvent()
This commit is contained in:
parent
8299001afe
commit
daeafccd49
@ -47,6 +47,10 @@ class QgsMapTool : QObject
|
||||
//! Mouse release event for overriding. Default implementation does nothing.
|
||||
virtual void canvasReleaseEvent( QMouseEvent * e );
|
||||
|
||||
//! Mouse wheel event for overriding. Default implementation does nothing.
|
||||
//! Added in version 2.0
|
||||
virtual void wheelEvent( QWheelEvent * e );
|
||||
|
||||
//! Key event for overriding. Default implementation does nothing.
|
||||
virtual void keyPressEvent( QKeyEvent* e );
|
||||
|
||||
|
@ -1094,6 +1094,11 @@ void QgsMapCanvas::wheelEvent( QWheelEvent *e )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mMapTool )
|
||||
{
|
||||
mMapTool->wheelEvent( e );
|
||||
}
|
||||
|
||||
if ( QgsApplication::keyboardModifiers() )
|
||||
{
|
||||
// leave the wheel for map tools if any modifier pressed
|
||||
|
@ -131,6 +131,11 @@ void QgsMapTool::canvasReleaseEvent( QMouseEvent *e )
|
||||
Q_UNUSED( e );
|
||||
}
|
||||
|
||||
void QgsMapTool::wheelEvent( QWheelEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
}
|
||||
|
||||
void QgsMapTool::keyPressEvent( QKeyEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
|
@ -30,6 +30,7 @@ class QgsMapLayer;
|
||||
class QgsMapCanvas;
|
||||
class QKeyEvent;
|
||||
class QMouseEvent;
|
||||
class QWheelEvent;
|
||||
class QgsPoint;
|
||||
class QgsRectangle;
|
||||
class QPoint;
|
||||
@ -61,6 +62,10 @@ class GUI_EXPORT QgsMapTool : public QObject
|
||||
//! Mouse release event for overriding. Default implementation does nothing.
|
||||
virtual void canvasReleaseEvent( QMouseEvent * e );
|
||||
|
||||
//! Mouse wheel event for overriding. Default implementation does nothing.
|
||||
//! Added in version 2.0
|
||||
virtual void wheelEvent ( QWheelEvent* e );
|
||||
|
||||
//! Key event for overriding. Default implementation does nothing.
|
||||
virtual void keyPressEvent( QKeyEvent* e );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user