QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgscreateannotationitemmaptool.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscreateannotationitemmaptool.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 QGSCREATEANNOTATIONITEMMAPTOOL_H
16#define QGSCREATEANNOTATIONITEMMAPTOOL_H
17
18#include "qgis_gui.h"
19#include "qgis_sip.h"
21#include "qgssettingstree.h"
22
25
41class GUI_EXPORT QgsCreateAnnotationItemMapToolHandler : public QObject
42{
43 Q_OBJECT
44
45 public:
46
50 QgsCreateAnnotationItemMapToolHandler( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, QObject *parent = nullptr );
51
53
58
63
73
74 signals:
75
82
83 private:
84 QgsMapCanvas *mMapCanvas = nullptr;
85 std::unique_ptr<QgsAnnotationItem> mCreatedItem;
86};
87
101{
102 public:
103#ifndef SIP_RUN
104 static inline QgsSettingsTreeNode *sTreeAnnotationTools = QgsSettingsTree::sTreeGui->createChildNode( QStringLiteral( "annotation-items" ) );
105#endif
106
108
113
117 virtual QgsMapTool *mapTool() = 0;
118};
119
120#endif // QGSCREATEANNOTATIONITEMMAPTOOL_H
A dockable widget used to handle the CAD tools on top of a selection of map tools.
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Represents a map layer containing a set of georeferenced annotations, e.g.
A handler object for map tools which create annotation items.
QgsAnnotationLayer * targetLayer()
Returns the target layer for newly created items.
QgsAnnotationItem * takeCreatedItem()
Takes the newly created item from the tool, transferring ownership to the caller.
void pushCreatedItem(QgsAnnotationItem *item)
Pushes a created item to the handler.
QgsCreateAnnotationItemMapToolHandler(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, QObject *parent=nullptr)
Constructor for QgsCreateAnnotationItemMapToolHandler, with the specified parent object.
void itemCreated()
Emitted by the tool when a new annotation item has been created.
An interface for map tools which create annotation items.
virtual ~QgsCreateAnnotationItemMapToolInterface()=default
virtual QgsCreateAnnotationItemMapToolHandler * handler() const =0
Returns the handler object for the map tool.
virtual QgsMapTool * mapTool()=0
Returns a reference to the associated map tool.
Map canvas is a class for displaying all GIS data types on a canvas.
Abstract base class for all map tools.
Definition qgsmaptool.h:72
A tree node for the settings tree to help organizing and introspecting the tree.
static QgsSettingsTreeNode * sTreeGui
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48