QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Types | Public Member Functions | Protected Member Functions | List of all members
QgsBrowserProxyModel Class Reference

A QSortFilterProxyModel subclass for filtering and sorting browser model items. More...

#include <qgsbrowserproxymodel.h>

Inheritance diagram for QgsBrowserProxyModel:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

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

Protected Member Functions

bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 

Detailed Description

A QSortFilterProxyModel subclass for filtering and sorting browser model items.

Since
QGIS 3.4

Definition at line 32 of file qgsbrowserproxymodel.h.

Member Enumeration Documentation

Filter syntax options.

Enumerator
Normal 

Standard string filtering.

Wildcards 

Wildcard filtering.

RegularExpression 

Regular expression filtering.

Definition at line 38 of file qgsbrowserproxymodel.h.

Constructor & Destructor Documentation

QgsBrowserProxyModel::QgsBrowserProxyModel ( QObject *  parent = nullptr)
explicit

Constructor for QgsBrowserProxyModel, with the specified parent object.

Definition at line 19 of file qgsbrowserproxymodel.cpp.

Member Function Documentation

QgsBrowserModel* QgsBrowserProxyModel::browserModel ( )
inline

Returns the underlying browser model.

See also
setBrowserModel()

Definition at line 62 of file qgsbrowserproxymodel.h.

Qt::CaseSensitivity QgsBrowserProxyModel::caseSensitivity ( ) const

Returns whether item filtering is case sensitive.

See also
setFilterCaseSensitivity()

Definition at line 72 of file qgsbrowserproxymodel.cpp.

QgsDataItem * QgsBrowserProxyModel::dataItem ( const QModelIndex &  index) const

Returns the data item at the specified proxy index, or a nullptr if no item exists at the index.

Definition at line 34 of file qgsbrowserproxymodel.cpp.

bool QgsBrowserProxyModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
overrideprotected

Definition at line 147 of file qgsbrowserproxymodel.cpp.

bool QgsBrowserProxyModel::filterByLayerType ( ) const
inline

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

See also
layerType()
setFilterByLayerType()

Definition at line 118 of file qgsbrowserproxymodel.h.

QString QgsBrowserProxyModel::filterString ( ) const

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

See also
setFilterString()

Definition at line 61 of file qgsbrowserproxymodel.cpp.

QgsBrowserProxyModel::FilterSyntax QgsBrowserProxyModel::filterSyntax ( ) const

Returns the filter syntax.

See also
setFilterSyntax()

Definition at line 48 of file qgsbrowserproxymodel.cpp.

QgsMapLayer::LayerType QgsBrowserProxyModel::layerType ( ) const

Returns the layer type to filter the model by.

This is only used if filterByLayerType() is true.

See also
setLayerType()
filterByLayerType()

Definition at line 156 of file qgsbrowserproxymodel.cpp.

void QgsBrowserProxyModel::setBrowserModel ( QgsBrowserModel model)

Sets the underlying browser model.

See also
browserModel()

Definition at line 28 of file qgsbrowserproxymodel.cpp.

void QgsBrowserProxyModel::setFilterByLayerType ( bool  enabled)

Sets whether the model is filtered by map layer type.

See also
filterByLayerType()
setLayerType()

Definition at line 167 of file qgsbrowserproxymodel.cpp.

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

Sets whether item filtering should be case sensitive.

See also
caseSensitivity()

Definition at line 66 of file qgsbrowserproxymodel.cpp.

void QgsBrowserProxyModel::setFilterString ( const QString &  filter)

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

See also
filterString()

Definition at line 53 of file qgsbrowserproxymodel.cpp.

void QgsBrowserProxyModel::setFilterSyntax ( FilterSyntax  syntax)

Sets the filter syntax.

See also
filterSyntax()

Definition at line 40 of file qgsbrowserproxymodel.cpp.

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

Sets the layer type to filter the model by.

This is only used if filterByLayerType() is true.

See also
layerType()
setFilterByLayerType()

Definition at line 161 of file qgsbrowserproxymodel.cpp.


The documentation for this class was generated from the following files: