Class: QgsCreateAnnotationItemMapToolHandler¶
- class qgis.gui.QgsCreateAnnotationItemMapToolHandler¶
Bases:
PyQt5.QtCore.QObject
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 thetakeCreatedItem()
implementation to take ownership of the newly created item whenever this signal is emitted.New in version 3.22.
QgsCreateAnnotationItemMapToolHandler(canvas:
QgsMapCanvas
, cadDockWidget:QgsAdvancedDigitizingDockWidget
, parent: QObject = None) Constructor forQgsCreateAnnotationItemMapToolHandler
, with the specifiedparent
object.Methods
Pushes a created
item
to the handler.Takes the newly created item from the tool, transferring ownership to the caller.
Returns the target layer for newly created items.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- itemCreated¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- pushCreatedItem(self, item: QgsAnnotationItem)¶
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 totakeCreatedItem()
.- Parameters:
item (QgsAnnotationItem) –
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- takeCreatedItem(self) QgsAnnotationItem ¶
Takes the newly created item from the tool, transferring ownership to the caller.
- Return type:
- targetLayer(self) QgsAnnotationLayer ¶
Returns the target layer for newly created items.
- Return type:
- timerEvent(self, QTimerEvent)¶