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

A layout item subclass for map legend filtering. More...

#include <qgslayoutitemlegend.h>

Inheritance diagram for QgsLegendFilterProxyModel:

Public Member Functions

 QgsLegendFilterProxyModel (QObject *parent=nullptr)
 Constructor for QgsLegendFilterProxyModel, with the specified parent object.
void setIsDefaultLegend (bool isDefault)
 Sets whether the legend is showing the default legend for a project (as opposed to a customized legend).
Public Member Functions inherited from QgsLayerTreeFilterProxyModel
 QgsLayerTreeFilterProxyModel (QObject *parent=nullptr)
 Constructor.
QList< QgsMapLayer * > checkedLayers () const
 Returns the checked layers.
int columnCount (const QModelIndex &parent) const override
QVariant data (const QModelIndex &index, int role) const override
Qt::ItemFlags flags (const QModelIndex &idx) const override
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
QgsLayerTreeModellayerTreeModel () const
 Rerturns the layer tree model.
QgsMapLayermapLayer (const QModelIndex &idx) const
 Returns the map layer at a given index.
bool nodeShown (QgsLayerTreeNode *node) const
 Returns true if the specified node will be shown in the model.
QModelIndex parent (const QModelIndex &child) const override
void setCheckedLayers (const QList< QgsMapLayer * > layers)
 Initialize the list of checked layers.
bool setData (const QModelIndex &index, const QVariant &value, int role) override
void setFilters (Qgis::LayerFilters filters)
 Defines the type layers (vector, raster, etc) shown in the tree If the list is empty, all types are shown.
void setLayerTreeModel (QgsLayerTreeModel *layerTreeModel)
 Sets the layer tree model.
void setShowPrivateLayers (bool showPrivate)
 Determines if private layers are shown.
bool showPrivateLayers () const
 Returns if private layers are shown.
QModelIndex sibling (int row, int column, const QModelIndex &idx) const override

Additional Inherited Members

Public Slots inherited from QgsLayerTreeFilterProxyModel
virtual void setFilterText (const QString &filterText=QString())
 Sets the filter text to search for a layer in the tree.
Protected Member Functions inherited from QgsLayerTreeFilterProxyModel
bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
virtual bool isLayerChecked (QgsMapLayer *layer) const
 Returns if the layer is checked or not.
virtual void setLayerChecked (QgsMapLayer *layer, bool checked)
 This will set if the layer is checked or not.

Detailed Description

A layout item subclass for map legend filtering.

Note
Not available in Python bindings
Since
QGIS 4.0

Definition at line 113 of file qgslayoutitemlegend.h.

Constructor & Destructor Documentation

◆ QgsLegendFilterProxyModel()

QgsLegendFilterProxyModel::QgsLegendFilterProxyModel ( QObject * parent = nullptr)

Constructor for QgsLegendFilterProxyModel, with the specified parent object.

Definition at line 56 of file qgslayoutitemlegend.cpp.

Member Function Documentation

◆ setIsDefaultLegend()

void QgsLegendFilterProxyModel::setIsDefaultLegend ( bool isDefault)

Sets whether the legend is showing the default legend for a project (as opposed to a customized legend).

Definition at line 62 of file qgslayoutitemlegend.cpp.


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