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;
204 QStringList mHiddenDataItemsKeys;
205 QStringList mShownDataItemsKeys;
208 QVector<QRegExp> mREList;
209 FilterSyntax mPatternSyntax = Normal;
210 Qt::CaseSensitivity mCaseSensitivity = Qt::CaseInsensitive;
212 bool mFilterByLayerType =
false;
213 bool mShowLayers =
true;
220 bool filterAcceptsString(
const QString &value )
const;
223 bool filterAcceptsAncestor(
const QModelIndex &sourceIndex )
const;
226 bool filterAcceptsDescendant(
const QModelIndex &sourceIndex )
const;
229 bool filterAcceptsItem(
const QModelIndex &sourceIndex )
const;
232 bool filterAcceptsProviderKey(
const QModelIndex &sourceIndex )
const;
235 bool filterRootAcceptsProviderKey(
const QModelIndex &sourceIndex )
const;
241 bool hasChildren(
const QModelIndex &parent = QModelIndex() )
const override;
244 #endif // QGSBROWSERPROXYMODEL_H