Class: QgsLayoutProxyModel¶
- class qgis.core.QgsLayoutProxyModel(layout: QgsLayout, parent: QObject = None)¶
Bases:
PyQt5.QtCore.QSortFilterProxyModel
Constructor for
QgsLayoutProxyModelm
, attached to the specifiedlayout
.Allows for filtering a
QgsLayoutModel
by item type.New in version 3.0:
Methods
Returns
True
if the model includes the empty item choice.beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
changePersistentIndex
createIndex
decodeData
Returns the list of specific items excluded from the model.
- param sourceRow
Returns the current item type filter, or QgsLayoutItemRegistry.LayoutItem if no item type filter is set.
Returns the layout item flags used for filtering the available items.
Returns the
QgsLayoutItem
corresponding to an index from the sourceQgsLayoutModel
model.Returns the associated layout.
- param left
Sets whether an optional empty layout item is present in the model.
Sets a list of specific
items
to exclude from the model.Sets the item type
filter
.Sets layout item flags to use for filtering the available items.
Returns the
QgsLayoutModel
used in this proxy model.- allowEmptyItem(self) bool ¶
Returns
True
if the model includes the empty item choice.See also
New in version 3.8.
- Return type
bool
- QgsLayoutProxyModel.beginInsertColumns(self, QModelIndex, int, int)
- QgsLayoutProxyModel.beginInsertRows(self, QModelIndex, int, int)
- QgsLayoutProxyModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsLayoutProxyModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsLayoutProxyModel.beginRemoveColumns(self, QModelIndex, int, int)
- QgsLayoutProxyModel.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- QgsLayoutProxyModel.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- QgsLayoutProxyModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
- customEvent(self, QEvent)¶
- QgsLayoutProxyModel.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)¶
- exceptedItemList(self) List[QgsLayoutItem] ¶
Returns the list of specific items excluded from the model.
See also
- Return type
List[QgsLayoutItem]
- filterAcceptsColumn(self, int, QModelIndex) bool ¶
- filterAcceptsRow(self, sourceRow: int, sourceParent: QModelIndex) bool ¶
- Parameters
sourceRow (int) –
sourceParent (QModelIndex) –
- Return type
bool
- filterType(self) QgsLayoutItemRegistry.ItemType ¶
Returns the current item type filter, or QgsLayoutItemRegistry.LayoutItem if no item type filter is set.
See also
- Return type
- invalidateFilter(self)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- itemFlags(self) QgsLayoutItem.Flags ¶
Returns the layout item flags used for filtering the available items.
Returns
None
if no flag based filtering is occurring.See also
New in version 3.16.
- Return type
- itemFromSourceIndex(self, sourceIndex: QModelIndex) QgsLayoutItem ¶
Returns the
QgsLayoutItem
corresponding to an index from the sourceQgsLayoutModel
model.- Parameters
sourceIndex (QModelIndex) –
- Return type
- lessThan(self, left: QModelIndex, right: QModelIndex) bool ¶
- Parameters
left (QModelIndex) –
right (QModelIndex) –
- Return type
bool
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setAllowEmptyItem(self, allowEmpty: bool)¶
Sets whether an optional empty layout item is present in the model.
See also
New in version 3.8.
- Parameters
allowEmpty (bool) –
- setExceptedItemList(self, items: Iterable[QgsLayoutItem])¶
Sets a list of specific
items
to exclude from the model.See also
- Parameters
items (Iterable[QgsLayoutItem]) –
- setFilterType(self, filter: QgsLayoutItemRegistry.ItemType)¶
Sets the item type
filter
. Only matching item types will be shown. Setfilter
to QgsLayoutItemRegistry.LayoutItem to show all item types.See also
- Parameters
filter (QgsLayoutItemRegistry.ItemType) –
- setItemFlags(self, flags: Union[QgsLayoutItem.Flags, QgsLayoutItem.Flag])¶
Sets layout item flags to use for filtering the available items.
Set
flags
toNone
to clear the flag based filtering.See also
New in version 3.16.
- Parameters
flags (Union[QgsLayoutItem.Flags) –
- sourceLayerModel(self) QgsLayoutModel ¶
Returns the
QgsLayoutModel
used in this proxy model.- Return type
- timerEvent(self, QTimerEvent)¶