16#ifndef QGSMAPLAYERPROXYMODEL_H
17#define QGSMAPLAYERPROXYMODEL_H
19#include <QSortFilterProxyModel>
38 Q_PROPERTY( Qgis::LayerFilters filters READ filters WRITE setFilters )
39 Q_PROPERTY( QList<
QgsMapLayer *> exceptedLayerList READ exceptedLayerList WRITE setExceptedLayerList )
40 Q_PROPERTY( QStringList exceptedLayerIds READ exceptedLayerIds WRITE setExceptedLayerIds )
77 const Qgis::LayerFilters &
filters()
const {
return mFilters; }
92 static bool layerMatchesFilters(
const QgsMapLayer *layer,
const Qgis::LayerFilters &filters );
105 Q_DECL_DEPRECATED
void setLayerWhitelist(
const QList<QgsMapLayer *> &layers )
SIP_DEPRECATED;
118 void setLayerAllowlist(
const QList<QgsMapLayer *> &layers );
150 void setExceptedLayerList(
const QList<QgsMapLayer *> &exceptList );
165 void setExceptedLayerIds(
const QStringList &ids );
172 QStringList exceptedLayerIds()
const;
178 void setExcludedProviders(
const QStringList &providers );
201 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
202 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
213 void setFilterString(
const QString &filter );
216 Qgis::LayerFilters mFilters;
217 QList<QgsMapLayer *> mExceptList;
218 QList<QgsMapLayer *> mLayerAllowlist;
220 QStringList mExcludedProviders;
221 QString mFilterString;
The QgsMapLayerModel class is a model to display layers in widgets.
The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widget...
const Qgis::LayerFilters & filters() const
Returns the filter flags which affect how layers are filtered within the model.
QList< QgsMapLayer * > exceptedLayerList()
Returns the blocklist of layers which are excluded from the model.
QList< QgsMapLayer * > layerAllowlist()
Returns the list of layers which are excluded from the model.
Q_DECL_DEPRECATED void setFilters(int filters)
Filters according to layer type and/or geometry type.
QStringList excludedProviders() const
Returns the blocklist of data providers which are excluded from the model.
Q_DECL_DEPRECATED QList< QgsMapLayer * > layerWhitelist()
Returns the list of layers which are excluded from the model.
QString filterString() const
Returns the current filter string, if set.
Base class for all map layer types.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...