QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Signals | Public Member Functions | List of all members
QgsCreateAnnotationItemMapToolHandler Class Reference

A handler object for map tools which create annotation items. More...

#include <qgscreateannotationitemmaptool.h>

Inheritance diagram for QgsCreateAnnotationItemMapToolHandler:
Inheritance graph
[legend]

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.
 
QgsAnnotationItemtakeCreatedItem ()
 Takes the newly created item from the tool, transferring ownership to the caller.
 
QgsAnnotationLayertargetLayer ()
 Returns the target layer for newly created items.
 

Detailed Description

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.

Since
QGIS 3.22

Definition at line 41 of file qgscreateannotationitemmaptool.h.

Constructor & Destructor Documentation

◆ QgsCreateAnnotationItemMapToolHandler()

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.

◆ ~QgsCreateAnnotationItemMapToolHandler()

QgsCreateAnnotationItemMapToolHandler::~QgsCreateAnnotationItemMapToolHandler ( )
overridedefault

Member Function Documentation

◆ itemCreated

void QgsCreateAnnotationItemMapToolHandler::itemCreated ( )
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.

◆ pushCreatedItem()

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.

◆ takeCreatedItem()

QgsAnnotationItem * QgsCreateAnnotationItemMapToolHandler::takeCreatedItem ( )

Takes the newly created item from the tool, transferring ownership to the caller.

Definition at line 29 of file qgscreateannotationitemmaptool.cpp.

◆ targetLayer()

QgsAnnotationLayer * QgsCreateAnnotationItemMapToolHandler::targetLayer ( )

Returns the target layer for newly created items.

Definition at line 36 of file qgscreateannotationitemmaptool.cpp.


The documentation for this class was generated from the following files: