QGIS API Documentation  3.6.0-Noosa (5873452)
Classes | Public Types | Signals | Public Member Functions | Properties | Friends | List of all members
QgsFeatureFilterModel Class Reference

Provides a list of features based on filter conditions. More...

#include <qgsfeaturefiltermodel.h>

Inheritance diagram for QgsFeatureFilterModel:
Inheritance graph
[legend]

Public Types

enum  Role { IdentifierValueRole = Qt::UserRole, ValueRole }
 Extra roles that can be used to fetch data from this model. More...
 

Signals

void allowNullChanged ()
 Add a NULL entry to the list. More...
 
void beginUpdate ()
 Notification that the model is about to be changed because a job was completed. More...
 
void displayExpressionChanged ()
 The display expression will be used for. More...
 
void endUpdate ()
 Notification that the model change is finished. More...
 
void extraIdentifierValueChanged ()
 Allows specifying one value that does not need to match the filter criteria but will still be available in the model. More...
 
void extraIdentifierValueIndexChanged (int index)
 The index at which the extra identifier value is available within the model. More...
 
void extraValueDoesNotExistChanged ()
 Flag indicating that the extraIdentifierValue does not exist in the data. More...
 
void filterExpressionChanged ()
 An additional filter expression to apply, next to the filterValue. More...
 
void filterJobCompleted ()
 Indicates that a filter job has been completed and new data may be available. More...
 
void filterValueChanged ()
 This value will be used to filter the features available from this model. More...
 
void identifierFieldChanged ()
 The identifier field should be a unique field that can be used to identify individual features. More...
 
void isLoadingChanged ()
 Indicator if the model is currently performing any feature iteration in the background. More...
 
void sourceLayerChanged ()
 The source layer from which features will be fetched. More...
 

Public Member Functions

 QgsFeatureFilterModel (QObject *parent=nullptr)
 Create a new QgsFeatureFilterModel, optionally specifying a parent. More...
 
 ~QgsFeatureFilterModel () override
 
bool allowNull () const
 Add a NULL entry to the list. More...
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QString displayExpression () const
 The display expression will be used for. More...
 
QVariant extraIdentifierValue () const
 Allows specifying one value that does not need to match the filter criteria but will still be available in the model. More...
 
int extraIdentifierValueIndex () const
 The index at which the extra identifier value is available within the model. More...
 
bool extraValueDoesNotExist () const
 Flag indicating that the extraIdentifierValue does not exist in the data. More...
 
QString filterExpression () const
 An additional filter expression to apply, next to the filterValue. More...
 
QString filterValue () const
 This value will be used to filter the features available from this model. More...
 
QString identifierField () const
 The identifier field should be a unique field that can be used to identify individual features. More...
 
QModelIndex index (int row, int column, const QModelIndex &parent) const override
 
bool isLoading () const
 Indicator if the model is currently performing any feature iteration in the background. More...
 
QModelIndex parent (const QModelIndex &child) const override
 
int rowCount (const QModelIndex &parent) const override
 
void setAllowNull (bool allowNull)
 Add a NULL entry to the list. More...
 
void setDisplayExpression (const QString &displayExpression)
 The display expression will be used for. More...
 
void setExtraIdentifierValue (const QVariant &extraIdentifierValue)
 Allows specifying one value that does not need to match the filter criteria but will still be available in the model. More...
 
void setFilterExpression (const QString &filterExpression)
 An additional filter expression to apply, next to the filterValue. More...
 
void setFilterValue (const QString &filterValue)
 This value will be used to filter the features available from this model. More...
 
void setIdentifierField (const QString &identifierField)
 The identifier field should be a unique field that can be used to identify individual features. More...
 
void setSourceLayer (QgsVectorLayer *sourceLayer)
 The source layer from which features will be fetched. More...
 
QgsVectorLayersourceLayer () const
 The source layer from which features will be fetched. More...
 

Properties

bool allowNull
 
QString displayExpression
 
QVariant extraIdentifierValue
 The value that identifies the current feature. More...
 
int extraIdentifierValueIndex
 
QString filterExpression
 
QString filterValue
 
QString identifierField
 A field of sourceLayer that is unique and should be used to identify features. More...
 
bool isLoading
 
QgsVectorLayer sourceLayer
 

Friends

class QgsFieldExpressionValuesGatherer
 

Detailed Description

Provides a list of features based on filter conditions.

Features are fetched asynchronously.

Since
QGIS 3.0

Definition at line 32 of file qgsfeaturefiltermodel.h.

Member Enumeration Documentation

◆ Role

Extra roles that can be used to fetch data from this model.

Enumerator
IdentifierValueRole 

Used to retrieve the identifierValue (primary key) of a feature.

ValueRole 

Used to retrieve the displayExpression of a feature.

Definition at line 62 of file qgsfeaturefiltermodel.h.

Constructor & Destructor Documentation

◆ QgsFeatureFilterModel()

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

Create a new QgsFeatureFilterModel, optionally specifying a parent.

Definition at line 24 of file qgsfeaturefiltermodel.cpp.

◆ ~QgsFeatureFilterModel()

QgsFeatureFilterModel::~QgsFeatureFilterModel ( )
override

Definition at line 33 of file qgsfeaturefiltermodel.cpp.

Member Function Documentation

◆ allowNull()

bool QgsFeatureFilterModel::allowNull ( ) const

Add a NULL entry to the list.

◆ allowNullChanged

void QgsFeatureFilterModel::allowNullChanged ( )
signal

Add a NULL entry to the list.

◆ beginUpdate

void QgsFeatureFilterModel::beginUpdate ( )
signal

Notification that the model is about to be changed because a job was completed.

◆ columnCount()

int QgsFeatureFilterModel::columnCount ( const QModelIndex &  parent) const
override

Definition at line 124 of file qgsfeaturefiltermodel.cpp.

◆ data()

QVariant QgsFeatureFilterModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 130 of file qgsfeaturefiltermodel.cpp.

◆ displayExpression()

QString QgsFeatureFilterModel::displayExpression ( ) const

The display expression will be used for.

  • displaying values in the combobox
  • filtering based on filterValue

◆ displayExpressionChanged

void QgsFeatureFilterModel::displayExpressionChanged ( )
signal

The display expression will be used for.

  • displaying values in the combobox
  • filtering based on filterValue

◆ endUpdate

void QgsFeatureFilterModel::endUpdate ( )
signal

Notification that the model change is finished.

Will always be emitted in sync with beginUpdate.

◆ extraIdentifierValue()

QVariant QgsFeatureFilterModel::extraIdentifierValue ( ) const

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

◆ extraIdentifierValueChanged

void QgsFeatureFilterModel::extraIdentifierValueChanged ( )
signal

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

◆ extraIdentifierValueIndex()

int QgsFeatureFilterModel::extraIdentifierValueIndex ( ) const

The index at which the extra identifier value is available within the model.

◆ extraIdentifierValueIndexChanged

void QgsFeatureFilterModel::extraIdentifierValueIndexChanged ( int  index)
signal

The index at which the extra identifier value is available within the model.

◆ extraValueDoesNotExist()

bool QgsFeatureFilterModel::extraValueDoesNotExist ( ) const

Flag indicating that the extraIdentifierValue does not exist in the data.

Definition at line 488 of file qgsfeaturefiltermodel.cpp.

◆ extraValueDoesNotExistChanged

void QgsFeatureFilterModel::extraValueDoesNotExistChanged ( )
signal

Flag indicating that the extraIdentifierValue does not exist in the data.

◆ filterExpression()

QString QgsFeatureFilterModel::filterExpression ( ) const

An additional filter expression to apply, next to the filterValue.

Can be used for spatial filtering etc.

◆ filterExpressionChanged

void QgsFeatureFilterModel::filterExpressionChanged ( )
signal

An additional filter expression to apply, next to the filterValue.

Can be used for spatial filtering etc.

◆ filterJobCompleted

void QgsFeatureFilterModel::filterJobCompleted ( )
signal

Indicates that a filter job has been completed and new data may be available.

◆ filterValue()

QString QgsFeatureFilterModel::filterValue ( ) const

This value will be used to filter the features available from this model.

Whenever a substring of the displayExpression of a feature matches the filter value, it will be accessible by this model.

◆ filterValueChanged

void QgsFeatureFilterModel::filterValueChanged ( )
signal

This value will be used to filter the features available from this model.

Whenever a substring of the displayExpression of a feature matches the filter value, it will be accessible by this model.

◆ identifierField()

QString QgsFeatureFilterModel::identifierField ( ) const

The identifier field should be a unique field that can be used to identify individual features.

It is normally set to the primary key of the layer.

◆ identifierFieldChanged

void QgsFeatureFilterModel::identifierFieldChanged ( )
signal

The identifier field should be a unique field that can be used to identify individual features.

It is normally set to the primary key of the layer.

◆ index()

QModelIndex QgsFeatureFilterModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const
override

Definition at line 105 of file qgsfeaturefiltermodel.cpp.

◆ isLoading()

bool QgsFeatureFilterModel::isLoading ( ) const

Indicator if the model is currently performing any feature iteration in the background.

◆ isLoadingChanged

void QgsFeatureFilterModel::isLoadingChanged ( )
signal

Indicator if the model is currently performing any feature iteration in the background.

◆ parent()

QModelIndex QgsFeatureFilterModel::parent ( const QModelIndex &  child) const
override

Definition at line 111 of file qgsfeaturefiltermodel.cpp.

◆ rowCount()

int QgsFeatureFilterModel::rowCount ( const QModelIndex &  parent) const
override

Definition at line 117 of file qgsfeaturefiltermodel.cpp.

◆ setAllowNull()

void QgsFeatureFilterModel::setAllowNull ( bool  allowNull)

Add a NULL entry to the list.

Definition at line 477 of file qgsfeaturefiltermodel.cpp.

◆ setDisplayExpression()

void QgsFeatureFilterModel::setDisplayExpression ( const QString &  displayExpression)

The display expression will be used for.

  • displaying values in the combobox
  • filtering based on filterValue

Definition at line 60 of file qgsfeaturefiltermodel.cpp.

◆ setExtraIdentifierValue()

void QgsFeatureFilterModel::setExtraIdentifierValue ( const QVariant &  extraIdentifierValue)

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

Definition at line 531 of file qgsfeaturefiltermodel.cpp.

◆ setFilterExpression()

void QgsFeatureFilterModel::setFilterExpression ( const QString &  filterExpression)

An additional filter expression to apply, next to the filterValue.

Can be used for spatial filtering etc.

Definition at line 90 of file qgsfeaturefiltermodel.cpp.

◆ setFilterValue()

void QgsFeatureFilterModel::setFilterValue ( const QString &  filterValue)

This value will be used to filter the features available from this model.

Whenever a substring of the displayExpression of a feature matches the filter value, it will be accessible by this model.

Definition at line 75 of file qgsfeaturefiltermodel.cpp.

◆ setIdentifierField()

void QgsFeatureFilterModel::setIdentifierField ( const QString &  identifierField)

The identifier field should be a unique field that can be used to identify individual features.

It is normally set to the primary key of the layer.

Definition at line 512 of file qgsfeaturefiltermodel.cpp.

◆ setSourceLayer()

void QgsFeatureFilterModel::setSourceLayer ( QgsVectorLayer sourceLayer)

The source layer from which features will be fetched.

Definition at line 44 of file qgsfeaturefiltermodel.cpp.

◆ sourceLayer()

QgsVectorLayer* QgsFeatureFilterModel::sourceLayer ( ) const

The source layer from which features will be fetched.

◆ sourceLayerChanged

void QgsFeatureFilterModel::sourceLayerChanged ( )
signal

The source layer from which features will be fetched.

Friends And Related Function Documentation

◆ QgsFieldExpressionValuesGatherer

friend class QgsFieldExpressionValuesGatherer
friend

Definition at line 308 of file qgsfeaturefiltermodel.h.

Property Documentation

◆ allowNull

bool QgsFeatureFilterModel::allowNull
readwrite

Definition at line 40 of file qgsfeaturefiltermodel.h.

◆ displayExpression

QString QgsFeatureFilterModel::displayExpression
readwrite

Definition at line 37 of file qgsfeaturefiltermodel.h.

◆ extraIdentifierValue

QVariant QgsFeatureFilterModel::extraIdentifierValue
readwrite

The value that identifies the current feature.

Definition at line 53 of file qgsfeaturefiltermodel.h.

◆ extraIdentifierValueIndex

int QgsFeatureFilterModel::extraIdentifierValueIndex
read

Definition at line 55 of file qgsfeaturefiltermodel.h.

◆ filterExpression

QString QgsFeatureFilterModel::filterExpression
readwrite

Definition at line 39 of file qgsfeaturefiltermodel.h.

◆ filterValue

QString QgsFeatureFilterModel::filterValue
readwrite

Definition at line 38 of file qgsfeaturefiltermodel.h.

◆ identifierField

QString QgsFeatureFilterModel::identifierField
readwrite

A field of sourceLayer that is unique and should be used to identify features.

Normally the primary key field. Needs to match the identifierValue.

Definition at line 48 of file qgsfeaturefiltermodel.h.

◆ isLoading

bool QgsFeatureFilterModel::isLoading
read

Definition at line 41 of file qgsfeaturefiltermodel.h.

◆ sourceLayer

QgsVectorLayer * QgsFeatureFilterModel::sourceLayer
readwrite

Definition at line 36 of file qgsfeaturefiltermodel.h.


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