Class: QgsLayoutManagerModel

class qgis.core.QgsLayoutManagerModel

Bases: PyQt5.QtCore.QAbstractListModel

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

New in version 3.8.

QgsLayoutManagerModel(manager: QgsLayoutManager, parent: QObject = None) Constructor for QgsLayoutManagerModel, showing the layouts from the specified manager.

Enums

CustomRole

Bases: enum.IntEnum

Role

alias of CustomRole

Methods

allowEmptyLayout

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

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

connectNotify

createIndex

customEvent

data

param index:

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

flags

param index:

indexFromLayout

Returns the model index corresponding to a layout.

isSignalConnected

layoutFromIndex

Returns the layout at the corresponding index.

persistentIndexList

receivers

resetInternalData

rowCount

param parent:

sender

senderSignalIndex

setAllowEmptyLayout

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

setData

param index:

timerEvent

class CustomRole(value)

Bases: enum.IntEnum

Custom model roles.

Note

Prior to QGIS 3.36 this was available as QgsLayoutManagerModel.Role

New in version 3.36.

  • LayoutRole: Layout object

baseClass

alias of QgsLayoutManagerModel

Role

alias of CustomRole

allowEmptyLayout(self) bool

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

Return type:

bool

beginInsertColumns(self, QModelIndex, int, int)
beginInsertRows(self, QModelIndex, int, int)
beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) bool
beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) bool
beginRemoveColumns(self, QModelIndex, int, int)
beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
createIndex(self, int, int, object: object = 0) QModelIndex
customEvent(self, QEvent)
data(self, index: QModelIndex, role: int) Any
Parameters:
  • index (QModelIndex) –

  • role (int) –

Return type:

Any

decodeData(self, int, int, QModelIndex, QDataStream) bool
disconnectNotify(self, QMetaMethod)
encodeData(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
flags(self, index: QModelIndex) Qt.ItemFlags
Parameters:

index (QModelIndex) –

Return type:

Qt.ItemFlags

indexFromLayout(self, layout: QgsMasterLayoutInterface) QModelIndex

Returns the model index corresponding to a layout.

Parameters:

layout (QgsMasterLayoutInterface) –

Return type:

QModelIndex

isSignalConnected(self, QMetaMethod) bool
layoutFromIndex(self, index: QModelIndex) QgsMasterLayoutInterface

Returns the layout at the corresponding index.

Parameters:

index (QModelIndex) –

Return type:

QgsMasterLayoutInterface

persistentIndexList(self) List[QModelIndex]
receivers(self, PYQT_SIGNAL) int
resetInternalData(self)
rowCount(self, parent: QModelIndex) int
Parameters:

parent (QModelIndex) –

Return type:

int

sender(self) QObject
senderSignalIndex(self) int
setAllowEmptyLayout(self, allowEmpty: bool)

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

Parameters:

allowEmpty (bool) –

setData(self, index: QModelIndex, value: Any, role: int = Qt.EditRole) bool
Parameters:
  • index (QModelIndex) –

  • value (Any) –

  • role (int = Qt.EditRole) –

Return type:

bool

timerEvent(self, QTimerEvent)