17 #ifndef QGSLAYERTREEFILTERPROXYMODEL_H
18 #define QGSLAYERTREEFILTERPROXYMODEL_H
20 #include <QSortFilterProxyModel>
22 #include "qgis_core.h"
52 void setCheckedLayers(
const QList<QgsMapLayer *> layers );
58 QgsMapLayer *mapLayer(
const QModelIndex &idx )
const;
69 void setFilters(
const QgsMapLayerProxyModel::Filters &filters );
71 virtual int columnCount(
const QModelIndex &parent )
const override;
72 virtual Qt::ItemFlags flags(
const QModelIndex &idx )
const override;
73 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
74 QModelIndex parent(
const QModelIndex &child )
const override;
75 QModelIndex sibling(
int row,
int column,
const QModelIndex &idx )
const override;
76 virtual QVariant data(
const QModelIndex &index,
int role )
const override;
77 virtual bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
81 virtual void setFilterText(
const QString &filterText = QString() );
85 virtual bool isLayerChecked(
QgsMapLayer *layer )
const;
88 virtual void setLayerChecked(
QgsMapLayer *layer,
bool checked );
90 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
98 virtual bool layerShown(
QgsMapLayer *layer )
const;
103 void setLayerCheckedPrivate(
QgsMapLayer *layer,
bool checked );
106 QList<QgsMapLayer *> mCheckedLayers;
QgsLayerTreeFilterProxyModel is a sort filter proxy model to easily reproduce the legend/layer tree i...
QList< QgsMapLayer * > checkedLayers() const
Returns the checked layers.
The QgsLayerTreeModel class is model implementation for Qt item views framework.
This class is a base class for nodes in a layer tree.
Base class for all map layer types.