15 #ifndef QGSBROWSERPROXYMODEL_H
16 #define QGSBROWSERPROXYMODEL_H
18 #include "qgis_core.h"
21 #include <QSortFilterProxyModel>
68 QgsDataItem *dataItem(
const QModelIndex &index )
const;
75 void setFilterSyntax( FilterSyntax syntax );
82 FilterSyntax filterSyntax()
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 );
162 void setHiddenDataItemProviderKeyFilter(
const QStringList &hiddenItemsFilter );
180 void setShownDataItemProviderKeyFilter(
const QStringList &shownItemsFilter );
188 bool showLayers()
const;
196 void setShowLayers(
bool showLayers );
201 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
209 QStringList mHiddenDataItemsKeys;
210 QStringList mShownDataItemsKeys;
212 QVector<QRegExp> mREList;
214 Qt::CaseSensitivity mCaseSensitivity = Qt::CaseInsensitive;
216 bool mFilterByLayerType =
false;
217 bool mShowLayers =
true;
224 bool filterAcceptsString(
const QString &value )
const;
227 bool filterAcceptsAncestor(
const QModelIndex &sourceIndex )
const;
230 bool filterAcceptsDescendant(
const QModelIndex &sourceIndex )
const;
233 bool filterAcceptsItem(
const QModelIndex &sourceIndex )
const;
236 bool filterAcceptsProviderKey(
const QModelIndex &sourceIndex )
const;
239 bool filterRootAcceptsProviderKey(
const QModelIndex &sourceIndex )
const;
245 bool hasChildren(
const QModelIndex &parent = QModelIndex() )
const override;
A model for showing available data sources and other items in a structured tree.
A QSortFilterProxyModel subclass for filtering and sorting browser model items.
FilterSyntax
Filter syntax options.
@ RegularExpression
Regular expression filtering.
@ Wildcards
Wildcard filtering.
@ Normal
Standard string filtering.
bool filterByLayerType() const
Returns true if the model is filtered by map layer type.
QgsBrowserModel * browserModel()
Returns the underlying browser model.
Base class for all items in the model.
QgsMapLayerType
Types of layers that can be added to a map.