Class: QgsLayoutManagerModel

List model representing the print layouts and reports available in a layout manager.

Added in version 3.8.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutManagerModel

Base classes

QgsProjectStoredObjectManagerModelBase

Base class for list models representing the objects available in a QgsAbstractProjectStoredObjectManager.

QAbstractListModel

QAbstractItemModel

QObject

class qgis.core.QgsLayoutManagerModel[source]

Bases: QgsProjectStoredObjectManagerModelBase

__init__(manager: QgsLayoutManager | None, parent: QObject | None = None)

Constructor for QgsLayoutManagerModel, showing the layouts from the specified manager.

Parameters:
class CustomRole(*values)

Bases: IntEnum

Custom model roles.

Note

Prior to QGIS 3.36 this was available as QgsLayoutManagerModel.Role

Added in version 3.36.

  • Layout: Layout object

    Available as QgsLayoutManagerModel.LayoutRole in older QGIS releases.

Role

alias of CustomRole

allowEmptyLayout(self) bool[source]

Returns True if the model allows the empty layout (“not set”) choice.

Return type:

bool

indexFromLayout(self, layout: QgsMasterLayoutInterface | None) QModelIndex[source]

Returns the model index corresponding to a layout.

Parameters:

layout (Optional[QgsMasterLayoutInterface])

Return type:

QModelIndex

layoutFromIndex(self, index: QModelIndex) QgsMasterLayoutInterface | None[source]

Returns the layout at the corresponding index.

Parameters:

index (QModelIndex)

Return type:

Optional[QgsMasterLayoutInterface]

setAllowEmptyLayout(self, allowEmpty: bool)[source]

Sets whether an optional empty layout (“not set”) option is present in the model.

Parameters:

allowEmpty (bool)