19 #include "qgsconfig.h"
26 #include <QGestureEvent>
41 class QAbstractButton;
76 sipType = sipType_QgsMapToolZoom;
78 sipType = sipType_QgsMapToolPan;
80 sipType = sipType_QgsMapToolEmitPoint;
82 sipType = sipType_QgsMapToolExtent;
84 sipType = sipType_QgsMapToolIdentifyFeature;
86 sipType = sipType_QgsMapToolIdentify;
88 sipType = sipType_QgsMapToolDigitizeFeature;
90 sipType = sipType_QgsMapToolCapture;
92 sipType = sipType_QgsMapToolAdvancedDigitizing;
94 sipType = sipType_QgsMapToolEdit;
114 AllowZoomRect = 1 << 3,
115 ShowContextMenu = 1 << 4,
117 Q_DECLARE_FLAGS( Flags, Flag )
123 virtual Flags flags()
const {
return Flags(); }
140 virtual void wheelEvent( QWheelEvent *e );
143 virtual void keyPressEvent( QKeyEvent *e );
146 virtual void keyReleaseEvent( QKeyEvent *e );
149 virtual bool gestureEvent( QGestureEvent *e );
156 virtual bool canvasToolTipEvent( QHelpEvent *e );
164 void setAction( QAction *action );
173 bool isActive()
const;
179 void setButton( QAbstractButton *button );
182 QAbstractButton *button();
185 virtual void setCursor(
const QCursor &cursor );
188 virtual void activate();
191 virtual void deactivate();
194 virtual void clean();
212 static double searchRadiusMM();
242 virtual void populateContextMenu( QMenu *menu );
262 virtual bool populateContextMenuWithEvent( QMenu *menu,
QgsMapMouseEvent *event );
269 void messageEmitted(
const QString &message,
Qgis::MessageLevel = Qgis::MessageLevel::Info );
272 void messageDiscarded();
282 void actionDestroyed();
314 QPoint toCanvasCoordinates(
const QgsPointXY &point )
const;
333 void setToolName(
const QString &name );
345 QAction *mAction =
nullptr;
351 QAbstractButton *mButton =
nullptr;
356 friend class TestQgsMapToolEdit;