QGIS API Documentation 3.41.0-Master (cea29feecf2)
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#define SIP_NO_FILE
23
26
27
53
78
79
89{
90 Q_OBJECT
91
92 public:
95
96 void cadCanvasReleaseEvent( QgsMapMouseEvent *event ) override;
97};
98
108{
109 Q_OBJECT
110
111 public:
114
115 private slots:
116 void lineCaptured( const QgsCurve *line ) override;
117};
118
128{
129 Q_OBJECT
130
131 public:
134
135 private slots:
136 void polygonCaptured( const QgsCurvePolygon *polygon ) override;
137};
138
148{
149 Q_OBJECT
150
151 public:
154
155 void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
156 void cadCanvasMoveEvent( QgsMapMouseEvent *event ) override;
157 void keyPressEvent( QKeyEvent *event ) override;
158
160 QgsMapTool *mapTool() override;
161
162 private:
163 QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
164
165 QRectF mRect;
166 QgsPointXY mFirstPoint;
168};
169
179{
180 Q_OBJECT
181
182 public:
183 static inline QgsSettingsTreeNode *sTreePicture = QgsCreateAnnotationItemMapToolInterface::sTreeAnnotationTools->createChildNode( QStringLiteral( "picture-item" ) );
185
188
189 void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
190 void cadCanvasMoveEvent( QgsMapMouseEvent *event ) override;
191 void keyPressEvent( QKeyEvent *event ) override;
192
194 QgsMapTool *mapTool() override;
195
196 private:
198 QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
199
200 QRectF mRect;
201 QgsPointXY mFirstPoint;
203};
204
214{
215 Q_OBJECT
216
217 public:
220
221 private slots:
222 void lineCaptured( const QgsCurve *line ) override;
223};
224
225
226#endif // QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
Keeps a pointer to a QObject and deletes it whenever this object is deleted.
CaptureTechnique
Capture technique.
Definition qgis.h:376
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
A handler object for map tools which create annotation items.
An interface for map tools which create annotation items.
A map tool to digitize line items.
QgsCreateLineItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
A map tool to digitize line text items.
QgsCreateLineTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
A map tool to digitize marker items.
QgsCreateMarkerItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
void cadCanvasReleaseEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
A map tool to digitize picture items.
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.
A map tool to digitize point text items.
~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.
A map tool to digitize polygon items.
QgsCreatePolygonItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
A map tool to digitize rectangle text items.
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:35
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:76
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
The QgsMapToolAdvancedDigitizing class is a QgsMapTool which gives event directly in map coordinates ...
A base class to digitize annotation items using QgsMapToolCapture.
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.
QgsMapToolCapture::Capabilities capabilities() const override
Returns flags containing the supported capabilities.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
QgsMapToolCapture is a base class capable of capturing point, lines and polygons.
QFlags< Capability > Capabilities
CaptureMode
Different capture modes.
Abstract base class for all map tools.
Definition qgsmaptool.h:71
A class to represent a 2D point.
Definition qgspointxy.h:60
A string settings entry.
QgsSettingsTreeNode is a tree node for the settings tree to help organizing and introspecting the tre...
QgsSettingsTreeNode * createChildNode(const QString &key)
Creates a normal tree node It will return the existing child node if it exists at the given key.