QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
A handler object for map tools which create annotation items. More...
#include <qgscreateannotationitemmaptool.h>
Signals | |
void | itemCreated () |
Emitted by the tool when a new annotation item has been created. | |
Public Member Functions | |
QgsCreateAnnotationItemMapToolHandler (QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, QObject *parent=nullptr) | |
Constructor for QgsCreateAnnotationItemMapToolHandler, with the specified parent object. | |
~QgsCreateAnnotationItemMapToolHandler () override | |
void | pushCreatedItem (QgsAnnotationItem *item) |
Pushes a created item to the handler. | |
QgsAnnotationItem * | takeCreatedItem () |
Takes the newly created item from the tool, transferring ownership to the caller. | |
QgsAnnotationLayer * | targetLayer () |
Returns the target layer for newly created items. | |
A handler object for map tools which create annotation items.
This object is designed to be used by map tools which implement the QgsCreateAnnotationItemMapToolInterface, following the composition pattern.
Clients should connect to the handler's itemCreated() signal, and call the takeCreatedItem() implementation to take ownership of the newly created item whenever this signal is emitted.
Definition at line 41 of file qgscreateannotationitemmaptool.h.
QgsCreateAnnotationItemMapToolHandler::QgsCreateAnnotationItemMapToolHandler | ( | QgsMapCanvas * | canvas, |
QgsAdvancedDigitizingDockWidget * | cadDockWidget, | ||
QObject * | parent = nullptr |
||
) |
Constructor for QgsCreateAnnotationItemMapToolHandler, with the specified parent object.
Definition at line 22 of file qgscreateannotationitemmaptool.cpp.
|
overridedefault |
|
signal |
Emitted by the tool when a new annotation item has been created.
Clients should connect to this signal and call takeCreatedItem() to take the newly created item from the map tool.
void QgsCreateAnnotationItemMapToolHandler::pushCreatedItem | ( | QgsAnnotationItem * | item | ) |
Pushes a created item to the handler.
Ownership of item is transferred to the handler.
Calling this method causes the object to emit the itemCreated() signal, and queue the item ready for collection via a call to takeCreatedItem().
Definition at line 44 of file qgscreateannotationitemmaptool.cpp.
QgsAnnotationItem * QgsCreateAnnotationItemMapToolHandler::takeCreatedItem | ( | ) |
Takes the newly created item from the tool, transferring ownership to the caller.
Definition at line 29 of file qgscreateannotationitemmaptool.cpp.
QgsAnnotationLayer * QgsCreateAnnotationItemMapToolHandler::targetLayer | ( | ) |
Returns the target layer for newly created items.
Definition at line 36 of file qgscreateannotationitemmaptool.cpp.