Class: QgsAnnotationItemAbstractGuiMetadata¶
Stores GUI metadata about one annotation item class.
This is a companion to QgsAnnotationItemAbstractMetadata
,
storing only the components related to the GUI behavior of an annotation
item.
Note
In C++ you can use QgsAnnotationItemGuiMetadata
convenience class.
Added in version 3.22.
Methods
Creates an instance of the corresponding item type. |
|
Creates a configuration widget for an item of this type. |
|
Creates a map tool for a creating a new item of this type. |
|
Returns an icon representing creation of the annotation item type. |
|
Returns item flags. |
|
Returns the item group ID, if set. |
|
Called when a newly created item of the associated type has been added to a layer. |
|
Returns the unique item type code for the annotation item class. |
|
Returns a translated, user visible name identifying the corresponding annotation item. |
- class qgis.gui.QgsAnnotationItemAbstractGuiMetadata[source]¶
Bases:
object
- __init__(type: str | None, visibleName: str | None, groupId: str | None = '', flags: Qgis.AnnotationItemGuiFlags | Qgis.AnnotationItemGuiFlag = Qgis.AnnotationItemGuiFlags())
Constructor for QgsAnnotationItemAbstractGuiMetadata with the specified class
type
.visibleName
should be set to a translated, user visible name identifying the corresponding annotation item.An optional
groupId
can be set, which allows grouping of related annotation item classes. SeeQgsAnnotationItemGuiMetadata
for details.- Parameters:
type (Optional[str])
visibleName (Optional[str])
groupId (Optional[str] = '')
flags (Union[Qgis.AnnotationItemGuiFlags, Qgis.AnnotationItemGuiFlag] = Qgis.AnnotationItemGuiFlags())
- __init__(a0: QgsAnnotationItemAbstractGuiMetadata)
- Parameters:
- createItem(self) QgsAnnotationItem | None [source]¶
Creates an instance of the corresponding item type.
- Return type:
Optional[QgsAnnotationItem]
- createItemWidget(self, item: QgsAnnotationItem | None) QgsAnnotationItemBaseWidget | None [source]¶
Creates a configuration widget for an
item
of this type. Can returnNone
if no configuration GUI is required.- Parameters:
item (Optional[QgsAnnotationItem])
- Return type:
Optional[QgsAnnotationItemBaseWidget]
- createMapTool(self, canvas: QgsMapCanvas | None, cadDockWidget: QgsAdvancedDigitizingDockWidget | None) QgsCreateAnnotationItemMapToolInterface | None [source]¶
Creates a map tool for a creating a new item of this type.
May return
None
if no map tool is available for creating the item.- Parameters:
canvas (Optional[QgsMapCanvas])
cadDockWidget (Optional[QgsAdvancedDigitizingDockWidget])
- Return type:
Optional[QgsCreateAnnotationItemMapToolInterface]
- creationIcon(self) QIcon [source]¶
Returns an icon representing creation of the annotation item type.
- Return type:
QIcon
- flags(self) Qgis.AnnotationItemGuiFlags [source]¶
Returns item flags.
- Return type:
- newItemAddedToLayer(self, item: QgsAnnotationItem | None, layer: QgsAnnotationLayer | None)[source]¶
Called when a newly created item of the associated type has been added to a
layer
.This is only called for additions which result from GUI operations - i.e. it is not called for items added programmatically.
- Parameters:
item (Optional[QgsAnnotationItem])
layer (Optional[QgsAnnotationLayer])