16#ifndef QGSMAPLAYERPROXYMODEL_H
17#define QGSMAPLAYERPROXYMODEL_H
19#include <QSortFilterProxyModel>
38 Q_PROPERTY( QgsMapLayerProxyModel::Filters filters READ filters WRITE setFilters )
39 Q_PROPERTY( QList<
QgsMapLayer *> exceptedLayerList READ exceptedLayerList WRITE setExceptedLayerList )
40 Q_PROPERTY( QStringList exceptedLayerIds READ exceptedLayerIds WRITE setExceptedLayerIds )
50 HasGeometry = PointLayer | LineLayer | PolygonLayer,
51 VectorLayer = NoGeometry | HasGeometry,
55 VectorTileLayer = 256,
56 PointCloudLayer = 512,
57 AnnotationLayer = 1024,
58 TiledSceneLayer = 2048,
59 All = RasterLayer | VectorLayer | PluginLayer | MeshLayer | VectorTileLayer | PointCloudLayer | AnnotationLayer | TiledSceneLayer,
60 SpatialLayer = RasterLayer | HasGeometry | PluginLayer | MeshLayer | VectorTileLayer | PointCloudLayer | AnnotationLayer | TiledSceneLayer
62 Q_DECLARE_FLAGS( Filters, Filter )
92 const Filters &
filters()
const {
return mFilters; }
107 static bool layerMatchesFilters(
const QgsMapLayer *layer,
const Filters &filters );
120 Q_DECL_DEPRECATED
void setLayerWhitelist(
const QList<QgsMapLayer *> &layers )
SIP_DEPRECATED;
133 void setLayerAllowlist(
const QList<QgsMapLayer *> &layers );
165 void setExceptedLayerList(
const QList<QgsMapLayer *> &exceptList );
180 void setExceptedLayerIds(
const QStringList &ids );
187 QStringList exceptedLayerIds()
const;
194 void setExcludedProviders(
const QStringList &providers );
218 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
219 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
230 void setFilterString(
const QString &filter );
234 QList<QgsMapLayer *> mExceptList;
235 QList<QgsMapLayer *> mLayerAllowlist;
237 QStringList mExcludedProviders;
238 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...
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.
QgsMapLayerModel * sourceLayerModel() const
layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
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.
const Filters & filters() const
Returns the filter flags which affect how layers are filtered within 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,...
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.