QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSMAPLAYERPROXYMODEL_H
17 #define QGSMAPLAYERPROXYMODEL_H
19 #include <QSortFilterProxyModel>
20 #include <QStringList>
22 #include "qgis_core.h"
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,
61 Q_DECLARE_FLAGS( Filters, Filter )
91 const Filters &
filters()
const {
return mFilters; }
106 static bool layerMatchesFilters(
const QgsMapLayer *layer,
const Filters &filters );
119 Q_DECL_DEPRECATED
void setLayerWhitelist(
const QList<QgsMapLayer *> &layers )
SIP_DEPRECATED;
132 void setLayerAllowlist(
const QList<QgsMapLayer *> &layers );
164 void setExceptedLayerList(
const QList<QgsMapLayer *> &exceptList );
179 void setExceptedLayerIds(
const QStringList &ids );
186 QStringList exceptedLayerIds()
const;
193 void setExcludedProviders(
const QStringList &providers );
217 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
218 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
229 void setFilterString(
const QString &filter );
233 QList<QgsMapLayer *> mExceptList;
234 QList<QgsMapLayer *> mLayerAllowlist;
236 QStringList mExcludedProviders;
237 QString mFilterString;
242 #endif // QGSMAPLAYERPROXYMODEL_H
const Filters & filters() const
Returns the filter flags which affect how layers are filtered within the model.
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
@ VectorLayer
Vector layer.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
QString filterString() const
Returns the current filter string, if set.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
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.
The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widget...
@ RasterLayer
Raster layer.
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.
QList< QgsMapLayer * > layerAllowlist()
Returns the list of layers which are excluded from the model.
QList< QgsMapLayer * > exceptedLayerList()
Returns the blocklist of layers which are excluded from the model.
Q_DECL_DEPRECATED QList< QgsMapLayer * > layerWhitelist()
Returns the list of layers which are excluded from the model.
Base class for all map layer types. This is the base class for all map layer types (vector,...
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
@ PluginLayer
Plugin based layer.
The QgsMapLayerModel class is a model to display layers in widgets.