16 #ifndef QGSMAPLAYERPROXYMODEL_H
17 #define QGSMAPLAYERPROXYMODEL_H
19 #include <QSortFilterProxyModel>
20 #include <QStringList>
22 #include "qgis_core.h"
37 Q_PROPERTY( QgsMapLayerProxyModel::Filters filters READ filters WRITE setFilters )
38 Q_PROPERTY( QList<
QgsMapLayer *> exceptedLayerList READ exceptedLayerList WRITE setExceptedLayerList )
39 Q_PROPERTY( QStringList exceptedLayerIds READ exceptedLayerIds WRITE setExceptedLayerIds )
49 HasGeometry = PointLayer | LineLayer | PolygonLayer,
57 Q_DECLARE_FLAGS( Filters, Filter )
87 const Filters &
filters()
const {
return mFilters; }
93 static bool layerMatchesFilters(
const QgsMapLayer *layer,
const Filters &filters );
106 Q_DECL_DEPRECATED
void setLayerWhitelist(
const QList<QgsMapLayer *> &layers )
SIP_DEPRECATED;
119 void setLayerAllowlist(
const QList<QgsMapLayer *> &layers );
151 void setExceptedLayerList(
const QList<QgsMapLayer *> &exceptList );
166 void setExceptedLayerIds(
const QStringList &ids );
173 QStringList exceptedLayerIds()
const;
180 void setExcludedProviders(
const QStringList &providers );
204 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
205 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
216 void setFilterString(
const QString &filter );
220 QList<QgsMapLayer *> mExceptList;
221 QList<QgsMapLayer *> mLayerAllowlist;
223 QStringList mExcludedProviders;
224 QString mFilterString;
227 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayerProxyModel::Filters )
229 #endif // QGSMAPLAYERPROXYMODEL_H