QgsLayoutProxyModel class

Allows for filtering a QgsLayoutModel by item type.

Constructors, destructors, conversion operators

QgsLayoutProxyModel(QgsLayout* layout, QObject* parent = nullptr)
Constructor for QgsLayoutProxyModelm, attached to the specified layout.

Public functions

auto exceptedItemList() const -> QList<QgsLayoutItem*>
Returns the list of specific items excluded from the model.
auto filterType() const -> QgsLayoutItemRegistry::ItemType
Returns the current item type filter, or QgsLayoutItemRegistry::LayoutItem if no item type filter is set.
auto itemFromSourceIndex(const QModelIndex& sourceIndex) const -> QgsLayoutItem*
Returns the QgsLayoutItem corresponding to an index from the source QgsLayoutModel model.
void setExceptedItemList(const QList<QgsLayoutItem*>& items)
Sets a list of specific items to exclude from the model.
void setFilterType(QgsLayoutItemRegistry::ItemType filter)
Sets the item type filter.
auto sourceLayerModel() const -> QgsLayoutModel*
Returns the QgsLayoutModel used in this proxy model.

Function documentation

QList<QgsLayoutItem*> QgsLayoutProxyModel::exceptedItemList() const

Returns the list of specific items excluded from the model.

QgsLayoutItemRegistry::ItemType QgsLayoutProxyModel::filterType() const

Returns the current item type filter, or QgsLayoutItemRegistry::LayoutItem if no item type filter is set.

void QgsLayoutProxyModel::setExceptedItemList(const QList<QgsLayoutItem*>& items)

Sets a list of specific items to exclude from the model.

void QgsLayoutProxyModel::setFilterType(QgsLayoutItemRegistry::ItemType filter)

Sets the item type filter.

Only matching item types will be shown. Set filter to QgsLayoutItemRegistry::LayoutItem to show all item types.