15 #ifndef QGSBROWSERPROXYMODEL_H 16 #define QGSBROWSERPROXYMODEL_H 18 #include "qgis_core.h" 21 #include <QSortFilterProxyModel> 68 QgsDataItem *dataItem(
const QModelIndex &index )
const;
89 void setFilterString(
const QString &filter );
96 QString filterString()
const;
103 void setFilterCaseSensitivity( Qt::CaseSensitivity sensitivity );
110 Qt::CaseSensitivity caseSensitivity()
const;
126 void setFilterByLayerType(
bool enabled );
159 void setDataItemProviderKeyFilter(
const QStringList &filter );
164 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
167 QStringList mHiddenDataItemsKeys;
170 QVector<QRegExp> mREList;
172 Qt::CaseSensitivity mCaseSensitivity = Qt::CaseInsensitive;
174 bool mFilterByLayerType =
false;
181 bool filterAcceptsString(
const QString &value )
const;
184 bool filterAcceptsAncestor(
const QModelIndex &sourceIndex )
const;
187 bool filterAcceptsDescendant(
const QModelIndex &sourceIndex )
const;
190 bool filterAcceptsItem(
const QModelIndex &sourceIndex )
const;
193 bool filterAcceptsProviderKey(
const QModelIndex &sourceIndex )
const;
196 bool filterRootAcceptsProviderKey(
const QModelIndex &sourceIndex )
const;
199 #endif // QGSBROWSERPROXYMODEL_H
FilterSyntax
Filter syntax options.
Regular expression filtering.
QgsBrowserModel * browserModel()
Returns the underlying browser model.
bool filterByLayerType() const
Returns true if the model is filtered by map layer type.
Base class for all items in the model.
Standard string filtering.
A QSortFilterProxyModel subclass for filtering and sorting browser model items.
A model for showing available data sources and other items in a structured tree.
QgsMapLayerType
Types of layers that can be added to a map.