Class: QgsAnnotationItemAbstractGuiMetadata¶
- class qgis.gui.QgsAnnotationItemAbstractGuiMetadata¶
Bases:
sip.wrapper
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.New in version 3.22.
QgsAnnotationItemAbstractGuiMetadata(type: str, visibleName: str, groupId: str = ‘’, flags: Union[Qgis.AnnotationItemGuiFlags, Qgis.AnnotationItemGuiFlag] = Qgis.AnnotationItemGuiFlags()) Constructor for
QgsAnnotationItemAbstractGuiMetadata
with the specified classtype
.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.QgsAnnotationItemAbstractGuiMetadata(
QgsAnnotationItemAbstractGuiMetadata
)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.
- createItem(self) QgsAnnotationItem ¶
Creates an instance of the corresponding item type.
- Return type:
- createItemWidget(self, item: QgsAnnotationItem) QgsAnnotationItemBaseWidget ¶
Creates a configuration widget for an
item
of this type. Can returnNone
if no configuration GUI is required.- Parameters:
item (QgsAnnotationItem) –
- Return type:
- createMapTool(self, canvas: QgsMapCanvas, cadDockWidget: QgsAdvancedDigitizingDockWidget) QgsCreateAnnotationItemMapToolInterface ¶
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 (QgsMapCanvas) –
cadDockWidget (QgsAdvancedDigitizingDockWidget) –
- Return type:
- creationIcon(self) QIcon ¶
Returns an icon representing creation of the annotation item type.
- Return type:
QIcon
- flags(self) Qgis.AnnotationItemGuiFlags ¶
Returns item flags.
- Return type:
- groupId(self) str ¶
Returns the item group ID, if set.
- Return type:
str
- newItemAddedToLayer(self, item: QgsAnnotationItem, layer: QgsAnnotationLayer)¶
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 (QgsAnnotationItem) –
layer (QgsAnnotationLayer) –
- type(self) str ¶
Returns the unique item type code for the annotation item class.
- Return type:
str
- visibleName(self) str ¶
Returns a translated, user visible name identifying the corresponding annotation item.
- Return type:
str