QgsBrowserProxyModel class

A QSortFilterProxyModel subclass for filtering and sorting browser model items.

Public types

enum FilterSyntax { Normal, Wildcards, RegularExpression }
Filter syntax options.

Constructors, destructors, conversion operators

QgsBrowserProxyModel(QObject* parent = nullptr) explicit
Constructor for QgsBrowserProxyModel, with the specified parent object.

Public functions

auto browserModel() -> QgsBrowserModel*
Returns the underlying browser model.
auto caseSensitivity() const -> Qt::CaseSensitivity
Returns whether item filtering is case sensitive.
auto dataItem(const QModelIndex& index) const -> QgsDataItem*
Returns the data item at the specified proxy index, or a nullptr if no item exists at the index.
auto filterByLayerType() const -> bool
Returns true if the model is filtered by map layer type.
auto filterString() const -> QString
Returns the filter string used when filtering items in the model.
auto filterSyntax() const -> FilterSyntax
Returns the filter syntax.
auto layerType() const -> QgsMapLayer::LayerType
Returns the layer type to filter the model by.
void setBrowserModel(QgsBrowserModel* model)
Sets the underlying browser model.
void setFilterByLayerType(bool enabled)
Sets whether the model is filtered by map layer type.
void setFilterCaseSensitivity(Qt::CaseSensitivity sensitivity)
Sets whether item filtering should be case sensitive.
void setFilterString(const QString& filter)
Sets the filter string to use when filtering items in the model.
void setFilterSyntax(FilterSyntax syntax)
Sets the filter syntax.
void setLayerType(QgsMapLayer::LayerType type)
Sets the layer type to filter the model by.

Enum documentation

enum QgsBrowserProxyModel::FilterSyntax

Filter syntax options.

Enumerators
Normal

Standard string filtering.

Wildcards

Wildcard filtering.

RegularExpression

Regular expression filtering.

Function documentation

QgsBrowserModel* QgsBrowserProxyModel::browserModel()

Returns the underlying browser model.

Qt::CaseSensitivity QgsBrowserProxyModel::caseSensitivity() const

Returns whether item filtering is case sensitive.

bool QgsBrowserProxyModel::filterByLayerType() const

Returns true if the model is filtered by map layer type.

QString QgsBrowserProxyModel::filterString() const

Returns the filter string used when filtering items in the model.

FilterSyntax QgsBrowserProxyModel::filterSyntax() const

Returns the filter syntax.

QgsMapLayer::LayerType QgsBrowserProxyModel::layerType() const

Returns the layer type to filter the model by.

This is only used if filterByLayerType() is true.

void QgsBrowserProxyModel::setBrowserModel(QgsBrowserModel* model)

Sets the underlying browser model.

void QgsBrowserProxyModel::setFilterByLayerType(bool enabled)

Sets whether the model is filtered by map layer type.

void QgsBrowserProxyModel::setFilterCaseSensitivity(Qt::CaseSensitivity sensitivity)

Sets whether item filtering should be case sensitive.

void QgsBrowserProxyModel::setFilterString(const QString& filter)

Sets the filter string to use when filtering items in the model.

void QgsBrowserProxyModel::setFilterSyntax(FilterSyntax syntax)

Sets the filter syntax.

void QgsBrowserProxyModel::setLayerType(QgsMapLayer::LayerType type)

Sets the layer type to filter the model by.

This is only used if filterByLayerType() is true.