QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsLayoutProxyModel Class Reference

Allows for filtering a QgsLayoutModel by item type. More...

#include <qgslayoutmodel.h>

Inheritance diagram for QgsLayoutProxyModel:

Public Member Functions

 QgsLayoutProxyModel (QgsLayout *layout, QObject *parent=nullptr)
 Constructor for QgsLayoutProxyModelm, attached to the specified layout.
bool allowEmptyItem () const
 Returns true if the model includes the empty item choice.
QList< QgsLayoutItem * > exceptedItemList () const
 Returns the list of specific items excluded from the model.
QgsLayoutItemRegistry::ItemType filterType () const
 Returns the current item type filter, or QgsLayoutItemRegistry::LayoutItem if no item type filter is set.
QgsLayoutItem::Flags itemFlags () const
 Returns the layout item flags used for filtering the available items.
QgsLayoutItemitemFromSourceIndex (const QModelIndex &sourceIndex) const
 Returns the QgsLayoutItem corresponding to an index from the source QgsLayoutModel model.
QgsLayoutlayout ()
 Returns the associated layout.
void setAllowEmptyItem (bool allowEmpty)
 Sets whether an optional empty layout item is present in the 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.
void setItemFlags (QgsLayoutItem::Flags flags)
 Sets layout item flags to use for filtering the available items.
QgsLayoutModelsourceLayerModel () const
 Returns the QgsLayoutModel used in this proxy model.

Protected Member Functions

bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override

Detailed Description

Allows for filtering a QgsLayoutModel by item type.

Definition at line 304 of file qgslayoutmodel.h.

Constructor & Destructor Documentation

◆ QgsLayoutProxyModel()

QgsLayoutProxyModel::QgsLayoutProxyModel ( QgsLayout * layout,
QObject * parent = nullptr )

Constructor for QgsLayoutProxyModelm, attached to the specified layout.

Definition at line 950 of file qgslayoutmodel.cpp.

Member Function Documentation

◆ allowEmptyItem()

bool QgsLayoutProxyModel::allowEmptyItem ( ) const

Returns true if the model includes the empty item choice.

See also
setAllowEmptyItem()
Since
QGIS 3.8

Definition at line 999 of file qgslayoutmodel.cpp.

◆ exceptedItemList()

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

Returns the list of specific items excluded from the model.

See also
setExceptedItemList()

Definition at line 340 of file qgslayoutmodel.h.

◆ filterAcceptsRow()

bool QgsLayoutProxyModel::filterAcceptsRow ( int sourceRow,
const QModelIndex & sourceParent ) const
overrideprotected

Definition at line 1030 of file qgslayoutmodel.cpp.

◆ filterType()

QgsLayoutItemRegistry::ItemType QgsLayoutProxyModel::filterType ( ) const
inline

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

See also
setFilterType()

Definition at line 320 of file qgslayoutmodel.h.

◆ itemFlags()

QgsLayoutItem::Flags QgsLayoutProxyModel::itemFlags ( ) const

Returns the layout item flags used for filtering the available items.

Returns nullptr if no flag based filtering is occurring.

See also
setItemFlags()
Since
QGIS 3.16

Definition at line 1010 of file qgslayoutmodel.cpp.

◆ itemFromSourceIndex()

QgsLayoutItem * QgsLayoutProxyModel::itemFromSourceIndex ( const QModelIndex & sourceIndex) const

Returns the QgsLayoutItem corresponding to an index from the source QgsLayoutModel model.

Definition at line 983 of file qgslayoutmodel.cpp.

◆ layout()

QgsLayout * QgsLayoutProxyModel::layout ( )
inline

Returns the associated layout.

Since
QGIS 3.8

Definition at line 357 of file qgslayoutmodel.h.

◆ lessThan()

bool QgsLayoutProxyModel::lessThan ( const QModelIndex & left,
const QModelIndex & right ) const
overrideprotected

Definition at line 962 of file qgslayoutmodel.cpp.

◆ setAllowEmptyItem()

void QgsLayoutProxyModel::setAllowEmptyItem ( bool allowEmpty)

Sets whether an optional empty layout item is present in the model.

See also
allowEmptyItem()
Since
QGIS 3.8

Definition at line 993 of file qgslayoutmodel.cpp.

◆ setExceptedItemList()

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

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

See also
exceptedItemList()

Definition at line 1021 of file qgslayoutmodel.cpp.

◆ setFilterType()

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.

See also
filterType()

Definition at line 1015 of file qgslayoutmodel.cpp.

◆ setItemFlags()

void QgsLayoutProxyModel::setItemFlags ( QgsLayoutItem::Flags flags)

Sets layout item flags to use for filtering the available items.

Set flags to nullptr to clear the flag based filtering.

See also
itemFlags()
Since
QGIS 3.16

Definition at line 1004 of file qgslayoutmodel.cpp.

◆ sourceLayerModel()

QgsLayoutModel * QgsLayoutProxyModel::sourceLayerModel ( ) const
inline

Returns the QgsLayoutModel used in this proxy model.

Definition at line 345 of file qgslayoutmodel.h.


The documentation for this class was generated from the following files: