QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgscreateannotationitemmaptool_impl.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscreateannotationitemmaptool_impl.h
3 ------------------------
4 Date : September 2021
5 Copyright : (C) 2021 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
16#define QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
17
18#include "qgis_gui.h"
20#include "qgsmaptoolcapture.h"
21
22#include <QString>
23
24using namespace Qt::StringLiterals;
25
26#define SIP_NO_FILE
27
30
31
57
82
83
102
112{
113 Q_OBJECT
114
115 public:
118
119 private slots:
120 void lineCaptured( const QgsCurve *line ) override;
121};
122
132{
133 Q_OBJECT
134
135 public:
138
139 private slots:
140 void polygonCaptured( const QgsCurvePolygon *polygon ) override;
141};
142
152{
153 Q_OBJECT
154
155 public:
158
159 void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
160 void cadCanvasMoveEvent( QgsMapMouseEvent *event ) override;
161 void keyPressEvent( QKeyEvent *event ) override;
162
164 QgsMapTool *mapTool() override;
165
166 private:
167 QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
168
169 QRectF mRect;
170 QgsPointXY mFirstPoint;
172};
173
183{
184 Q_OBJECT
185
186 public:
189
192
193 void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
194 void cadCanvasMoveEvent( QgsMapMouseEvent *event ) override;
195 void keyPressEvent( QKeyEvent *event ) override;
196
198 QgsMapTool *mapTool() override;
199
200 private:
202 QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
203
204 QRectF mRect;
205 QgsPointXY mFirstPoint;
207};
208
218{
219 Q_OBJECT
220
221 public:
224
225 private slots:
226 void lineCaptured( const QgsCurve *line ) override;
227};
228
229
230#endif // QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
Keeps a pointer to a QObject and deletes it whenever this object is deleted.
CaptureTechnique
Capture technique.
Definition qgis.h:404
A dockable widget used to handle the CAD tools on top of a selection of map tools.
A handler object for map tools which create annotation items.
An interface for map tools which create annotation items.
QgsCreateLineItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateLineTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateMarkerItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
void cadCanvasReleaseEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void cadCanvasMoveEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
static const QgsSettingsEntryString * settingLastSourceFolder
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void keyPressEvent(QKeyEvent *event) override
Key event for overriding. Default implementation does nothing.
QgsCreatePictureItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
~QgsCreatePointTextItemMapTool() override
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
QgsCreatePointTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
QgsCreatePolygonItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateRectangleTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
void cadCanvasMoveEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void keyPressEvent(QKeyEvent *event) override
Key event for overriding. Default implementation does nothing.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
Curve polygon geometry type.
Abstract base class for curved geometry type.
Definition qgscurve.h:36
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:83
A mouse event which is the result of a user interaction with a QgsMapCanvas.
QgsAdvancedDigitizingDockWidget * cadDockWidget() const
QgsMapToolAdvancedDigitizing(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Creates an advanced digitizing maptool.
QgsMapToolCaptureAnnotationItem(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
bool supportsTechnique(Qgis::CaptureTechnique technique) const override
Returns true if the tool supports the specified capture technique.
QgsMapLayer * layer() const override
Returns the layer associated with the map tool.
QgsCreateAnnotationItemMapToolHandler * mHandler
QgsMapToolCapture::Capabilities capabilities() const override
Returns flags containing the supported capabilities.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
CaptureMode mode() const
The capture mode.
QgsMapToolCapture(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode)
constructor
QFlags< Capability > Capabilities
CaptureMode
Different capture modes.
virtual void polygonCaptured(const QgsCurvePolygon *polygon)
Called when a polygon is captured.
virtual void lineCaptured(const QgsCurve *line)
Called when a line is captured.
Abstract base class for all map tools.
Definition qgsmaptool.h:72
QgsMapCanvas * canvas() const
returns pointer to the tool's map canvas
QgsMapTool(QgsMapCanvas *canvas)
Constructor takes a map canvas as a parameter.
friend class QgsMapCanvas
Definition qgsmaptool.h:380
Represents a 2D point.
Definition qgspointxy.h:62
A string settings entry.
A tree node for the settings tree to help organizing and introspecting the tree.