Class: QgsLayoutItemBaseWidget¶
A base class for property widgets for layout items.
All layout item widgets should inherit from this base class.
Class Hierarchy¶
Base classes¶
Base class for any widget that can be shown as an inline panel. |
|
- class qgis.gui.QgsLayoutItemBaseWidget[source]¶
Bases:
QgsPanelWidget- __init__(parent: QWidget | None, layoutObject: QgsLayoutObject | None)
Constructor for QgsLayoutItemBaseWidget, linked with the specified
layoutObject.- Parameters:
parent (Optional[QWidget])
layoutObject (Optional[QgsLayoutObject])
- coverageLayer(self) QgsVectorLayer | None[source]¶
Returns the current layout context coverage layer (if set).
- Return type:
Optional[QgsVectorLayer]
- layoutAtlas(self) QgsLayoutAtlas | None[source]¶
Returns the atlas for the layout (if available)
- Return type:
Optional[QgsLayoutAtlas]
- layoutObject(self) QgsLayoutObject | None[source]¶
Returns the layout object associated with this widget.
- Return type:
Optional[QgsLayoutObject]
- registerDataDefinedButton(self, button: QgsPropertyOverrideButton | None, property: QgsLayoutObject.DataDefinedProperty)[source]¶
Registers a data defined
button, setting up its initial value, connections and description. The corresponding propertykeymust be specified.- Parameters:
button (Optional[QgsPropertyOverrideButton])
property (QgsLayoutObject.DataDefinedProperty)
- virtual setDesignerInterface(self, iface: QgsLayoutDesignerInterface | None)[source]¶
Sets the the layout designer interface in which the widget is being shown.
Added in version 3.6.
- Parameters:
iface (Optional[QgsLayoutDesignerInterface])
- setItem(self, item: QgsLayoutItem | None) bool[source]¶
Sets the current
itemto show in the widget. IfTrueis returned,itemwas an acceptable type for display in this widget and the widget has been updated to matchitem’s properties.If
Falseis returned, then the widget could not be successfully updated to show the properties ofitem.- Parameters:
item (Optional[QgsLayoutItem])
- Return type:
bool
- virtual setMasterLayout(self, masterLayout: QgsMasterLayoutInterface | None)[source]¶
Sets the master layout associated with the item.
Added in version 3.10.
- Parameters:
masterLayout (Optional[QgsMasterLayoutInterface])
- virtual setNewItem(self, item: QgsLayoutItem | None) bool[source]¶
Attempts to update the widget to show the properties for the specified
item.Subclasses can override this if they support changing items in place.
Implementations must return
Trueif the item was accepted and the widget was updated.- Parameters:
item (Optional[QgsLayoutItem])
- Return type:
bool
- virtual setReportTypeString(self, string: str | None)[source]¶
Sets the
stringto use to describe the current report type (e.g. “atlas” or “report”). Subclasses which display this text to users should override this and update their widget labels accordingly.- Parameters:
string (Optional[str])
- updateDataDefinedButton(self, button: QgsPropertyOverrideButton | None)[source]¶
Updates a previously registered data defined button to reflect the item’s current properties.
- Parameters:
button (Optional[QgsPropertyOverrideButton])