Class: QgsLayoutModel¶
A model for items attached to a layout.
The model also maintains the z-order for the layout, and must be notified whenever item stacking changes.
Internally, QgsLayoutModel maintains two lists. One contains
a complete list of all items for the layout, ordered by their position
within the z-order stack.
The second list contains only items which are currently displayed in the layout’s scene. It is used as a cache of the last known stacking order, so that the model can compare the current stacking of items in the layout to the last known state, and emit the corresponding signals as required.
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Enums
Methods
Returns the QModelIndex corresponding to a |
|
Returns the |
- class qgis.core.QgsLayoutModel[source]¶
Bases:
QAbstractItemModel- __init__(layout: QgsLayout | None, parent: QObject | None = None)
Constructor for a QgsLayoutModel attached to the specified
layout.
- ItemId = 2¶
- LockStatus = 1¶
- Visibility = 0¶
- indexForItem(self, item: QgsLayoutItem | None, column: int = 0) QModelIndex[source]¶
Returns the QModelIndex corresponding to a
QgsLayoutItemitemandcolumn, if possible.See also
- Parameters:
item (Optional[QgsLayoutItem])
column (int = 0)
- Return type:
QModelIndex
- itemFromIndex(self, index: QModelIndex) QgsLayoutItem | None[source]¶
Returns the
QgsLayoutItemcorresponding to a QModelIndexindex, if possible.See also
- Parameters:
index (QModelIndex)
- Return type: