Class: QgsLayoutItemAbstractGuiMetadata¶
-
class
qgis.gui.
QgsLayoutItemAbstractGuiMetadata
(type: int, visibleName: str, groupId: str = '', isNodeBased: bool = False, flags: Union[QgsLayoutItemAbstractGuiMetadata.Flags, QgsLayoutItemAbstractGuiMetadata.Flag] = 0)¶ Bases:
sip.wrapper
Constructor for QgsLayoutItemAbstractGuiMetadata with the specified class
type
.visibleName
should be set to a translated, user visible name identifying the corresponding layout item.An optional
groupId
can be set, which allows grouping of related layout item classes. See QgsLayoutItemGuiMetadata for details.If
isNodeBased
isTrue
, then the corresponding item is a node based item.QgsLayoutItemAbstractGuiMetadata(QgsLayoutItemAbstractGuiMetadata)
Stores GUI metadata about one layout item class.
This is a companion to QgsLayoutItemAbstractMetadata, storing only the components related to the GUI behavior of a layout item.
Note
In C++ you can use QgsLayoutItemGuiMetadata convenience class.
New in version 3.0: Enums
Methods
Creates an instance of the corresponding item type.
Creates a configuration widget for an
item
of this type.Creates a rubber band for use when creating layout node based items of this type.
Creates a rubber band for use when creating layout items of this type.
Returns an icon representing creation of the layout item type.
Returns item flags.
Returns the item group ID, if set.
Returns
True
if the associated item is a node based item.Called when a newly created item of the associated type has been added to a layout.
Returns the unique item type code for the layout item class.
Returns a translated, user visible name identifying the corresponding layout item.
Signals
Attributes
-
class
Flag
¶ Bases:
int
-
FlagNoCreationTools
= 2¶
-
class
Flags
¶ Bases:
sip.wrapper
QgsLayoutItemAbstractGuiMetadata.Flags(Union[QgsLayoutItemAbstractGuiMetadata.Flags, QgsLayoutItemAbstractGuiMetadata.Flag]) QgsLayoutItemAbstractGuiMetadata.Flags(QgsLayoutItemAbstractGuiMetadata.Flags)
-
createItem
(self, layout: QgsLayout) → QgsLayoutItem¶ Creates an instance of the corresponding item type.
-
createItemWidget
(self, item: QgsLayoutItem) → QgsLayoutItemBaseWidget¶ Creates a configuration widget for an
item
of this type. Can returnNone
if no configuration GUI is required.
-
createNodeRubberBand
(self, view: QgsLayoutView) → QAbstractGraphicsShapeItem¶ Creates a rubber band for use when creating layout node based items of this type. Can return
None
if no rubber band should be created. The default behavior is to returnNone
.See also
-
createRubberBand
(self, view: QgsLayoutView) → QgsLayoutViewRubberBand¶ Creates a rubber band for use when creating layout items of this type. Can return
None
if no rubber band should be created. The default behavior is to create a rectangular rubber band.See also
-
creationIcon
(self) → QIcon¶ Returns an icon representing creation of the layout item type.
-
flags
(self) → QgsLayoutItemAbstractGuiMetadata.Flags¶ Returns item flags.
-
groupId
(self) → str¶ Returns the item group ID, if set.
-
isNodeBased
(self) → bool¶ Returns
True
if the associated item is a node based item.
-
newItemAddedToLayout
(self, item: QgsLayoutItem)¶ Called when a newly created item of the associated type has been added to a layout.
This is only called for additions which result from GUI operations - i.e. it is not called for items added from templates.
-
type
(self) → int¶ Returns the unique item type code for the layout item class.
-
visibleName
(self) → str¶ Returns a translated, user visible name identifying the corresponding layout item.
-
class