17 #ifndef QGSLAYERTREEFILTERPROXYMODEL_H
18 #define QGSLAYERTREEFILTERPROXYMODEL_H
20 #include <QSortFilterProxyModel>
22 #include "qgis_core.h"
51 void setCheckedLayers(
const QList<QgsMapLayer *> layers );
57 QgsMapLayer *mapLayer(
const QModelIndex &idx )
const;
68 void setFilters(
const QgsMapLayerProxyModel::Filters &filters );
70 virtual int columnCount(
const QModelIndex &parent )
const override;
71 virtual Qt::ItemFlags flags(
const QModelIndex &idx )
const override;
72 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
73 QModelIndex parent(
const QModelIndex &child )
const override;
74 QModelIndex sibling(
int row,
int column,
const QModelIndex &idx )
const override;
75 virtual QVariant data(
const QModelIndex &index,
int role )
const override;
76 virtual bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
80 virtual void setFilterText(
const QString &filterText = QString() );
84 virtual bool isLayerChecked(
QgsMapLayer *layer )
const;
87 virtual void setLayerChecked(
QgsMapLayer *layer,
bool checked );
89 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
97 virtual bool layerShown(
QgsMapLayer *layer )
const;
102 void setLayerCheckedPrivate(
QgsMapLayer *layer,
bool checked );
105 QList<QgsMapLayer *> mCheckedLayers;
110 #endif // QGSLAYERTREEFILTERPROXYMODEL_H