QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
annotations
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
"
20
#include "
qgsmaptooladvanceddigitizing.h
"
21
#include "
qgssettingstree.h
"
22
23
#include <QString>
24
25
using namespace
Qt::StringLiterals;
26
27
class
QgsAnnotationItem
;
28
class
QgsAnnotationLayer
;
29
45
class
GUI_EXPORT
QgsCreateAnnotationItemMapToolHandler
:
public
QObject
46
{
47
Q_OBJECT
48
49
public
:
53
QgsCreateAnnotationItemMapToolHandler
(
QgsMapCanvas
*canvas,
QgsAdvancedDigitizingDockWidget
*cadDockWidget, QObject *parent =
nullptr
);
54
55
~QgsCreateAnnotationItemMapToolHandler
()
override
;
56
60
QgsAnnotationItem
*
takeCreatedItem
()
SIP_TRANSFERBACK
;
61
65
QgsAnnotationLayer
*
targetLayer
();
66
75
void
pushCreatedItem
(
QgsAnnotationItem
*item
SIP_TRANSFER
);
76
77
signals:
78
84
void
itemCreated
();
85
86
private:
87
QgsMapCanvas
*mMapCanvas =
nullptr
;
88
std::unique_ptr<
QgsAnnotationItem
> mCreatedItem;
89
};
90
103
class GUI_EXPORT
QgsCreateAnnotationItemMapToolInterface
104
{
105
public
:
106
#ifndef SIP_RUN
107
static
inline
QgsSettingsTreeNode
*
sTreeAnnotationTools
=
QgsSettingsTree::sTreeGui
->createChildNode( u
"annotation-items"
_s );
108
#endif
109
110
virtual
~QgsCreateAnnotationItemMapToolInterface
() =
default
;
111
115
virtual
QgsCreateAnnotationItemMapToolHandler
*
handler
()
const
= 0;
116
120
virtual
QgsMapTool
*
mapTool
() = 0;
121
};
122
123
#endif
// QGSCREATEANNOTATIONITEMMAPTOOL_H
QgsAdvancedDigitizingDockWidget
A dockable widget used to handle the CAD tools on top of a selection of map tools.
Definition
qgsadvanceddigitizingdockwidget.h:55
QgsAnnotationItem
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Definition
qgsannotationitem.h:49
QgsAnnotationLayer
Represents a map layer containing a set of georeferenced annotations, e.g.
Definition
qgsannotationlayer.h:52
QgsCreateAnnotationItemMapToolHandler
A handler object for map tools which create annotation items.
Definition
qgscreateannotationitemmaptool.h:46
QgsCreateAnnotationItemMapToolHandler::targetLayer
QgsAnnotationLayer * targetLayer()
Returns the target layer for newly created items.
Definition
qgscreateannotationitemmaptool.cpp:38
QgsCreateAnnotationItemMapToolHandler::~QgsCreateAnnotationItemMapToolHandler
~QgsCreateAnnotationItemMapToolHandler() override
QgsCreateAnnotationItemMapToolHandler::takeCreatedItem
QgsAnnotationItem * takeCreatedItem()
Takes the newly created item from the tool, transferring ownership to the caller.
Definition
qgscreateannotationitemmaptool.cpp:31
QgsCreateAnnotationItemMapToolHandler::pushCreatedItem
void pushCreatedItem(QgsAnnotationItem *item)
Pushes a created item to the handler.
Definition
qgscreateannotationitemmaptool.cpp:46
QgsCreateAnnotationItemMapToolHandler::QgsCreateAnnotationItemMapToolHandler
QgsCreateAnnotationItemMapToolHandler(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, QObject *parent=nullptr)
Constructor for QgsCreateAnnotationItemMapToolHandler, with the specified parent object.
Definition
qgscreateannotationitemmaptool.cpp:24
QgsCreateAnnotationItemMapToolHandler::itemCreated
void itemCreated()
Emitted by the tool when a new annotation item has been created.
QgsCreateAnnotationItemMapToolInterface
An interface for map tools which create annotation items.
Definition
qgscreateannotationitemmaptool.h:104
QgsCreateAnnotationItemMapToolInterface::~QgsCreateAnnotationItemMapToolInterface
virtual ~QgsCreateAnnotationItemMapToolInterface()=default
QgsCreateAnnotationItemMapToolInterface::handler
virtual QgsCreateAnnotationItemMapToolHandler * handler() const =0
Returns the handler object for the map tool.
QgsCreateAnnotationItemMapToolInterface::sTreeAnnotationTools
static QgsSettingsTreeNode * sTreeAnnotationTools
Definition
qgscreateannotationitemmaptool.h:107
QgsCreateAnnotationItemMapToolInterface::mapTool
virtual QgsMapTool * mapTool()=0
Returns a reference to the associated map tool.
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsMapTool
Abstract base class for all map tools.
Definition
qgsmaptool.h:74
QgsSettingsTreeNode
A tree node for the settings tree to help organizing and introspecting the tree.
Definition
qgssettingstreenode.h:48
QgsSettingsTree::sTreeGui
static QgsSettingsTreeNode * sTreeGui
Definition
qgssettingstree.h:61
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:47
qgsmaptooladvanceddigitizing.h
qgssettingstree.h
Generated on
for QGIS API Documentation by
1.17.0