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,
50 VectorLayer = NoGeometry | HasGeometry,
53 All = RasterLayer | VectorLayer | PluginLayer
55 Q_DECLARE_FLAGS( Filters,
Filter )
75 const Filters &
filters()
const {
return mFilters; }
78 void setExceptedLayerList(
const QList<QgsMapLayer *> &exceptList );
83 void setExceptedLayerIds(
const QStringList &ids );
85 QStringList exceptedLayerIds()
const;
92 void setExcludedProviders(
const QStringList &providers );
101 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
102 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
106 QList<QgsMapLayer *> mExceptList;
108 QStringList mExcludedProviders;
111 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayerProxyModel::Filters )
113 #endif // QGSMAPLAYERPROXYMODEL_H Base class for all map layer types.
QList< QgsMapLayer * > exceptedLayerList()
Get the list of maplayers which are excluded from the list.
QStringList excludedProviders() const
Returns the list of data providers which are excluded from the model.
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...
QgsMapLayerModel * sourceLayerModel() const
layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
const Filters & filters() const