17#ifndef QGSLAYERTREEFILTERPROXYMODEL_H
18#define QGSLAYERTREEFILTERPROXYMODEL_H
20#include <QSortFilterProxyModel>
52 void setCheckedLayers(
const QList<QgsMapLayer *> layers );
58 QgsMapLayer *mapLayer(
const QModelIndex &idx )
const;
72 bool showPrivateLayers()
const;
81 void setShowPrivateLayers(
bool showPrivate );
89 virtual int columnCount(
const QModelIndex &parent )
const override;
90 virtual Qt::ItemFlags flags(
const QModelIndex &idx )
const override;
91 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
92 QModelIndex parent(
const QModelIndex &child )
const override;
93 QModelIndex sibling(
int row,
int column,
const QModelIndex &idx )
const override;
94 virtual QVariant data(
const QModelIndex &index,
int role )
const override;
95 virtual bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
106 virtual void setFilterText(
const QString &filterText = QString() );
110 virtual bool isLayerChecked(
QgsMapLayer *layer )
const;
113 virtual void setLayerChecked(
QgsMapLayer *layer,
bool checked );
115 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
123 virtual bool layerShown(
QgsMapLayer *layer )
const;
126 void setLayerCheckedPrivate(
QgsMapLayer *layer,
bool checked );
129 QList<QgsMapLayer *> mCheckedLayers;
132 bool mShowPrivateLayers =
true;
QFlags< LayerFilter > LayerFilters
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.