QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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

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 ( QObject *  parent = nullptr)
explicit

Create a new QgsFeatureFilterModel, optionally specifying a parent.

Definition at line 23 of file qgsfeaturefiltermodel.cpp.

QgsFeatureFilterModel::~QgsFeatureFilterModel ( )
override

Definition at line 32 of file qgsfeaturefiltermodel.cpp.

Member Function Documentation

bool QgsFeatureFilterModel::allowNull ( ) const

Add a NULL entry to the list.

void QgsFeatureFilterModel::allowNullChanged ( )
signal

Add a NULL entry to the list.

void QgsFeatureFilterModel::beginUpdate ( )
signal

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

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

Definition at line 123 of file qgsfeaturefiltermodel.cpp.

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

Definition at line 129 of file qgsfeaturefiltermodel.cpp.

QString QgsFeatureFilterModel::displayExpression ( ) const

The display expression will be used for.

  • displaying values in the combobox
  • filtering based on filterValue
void QgsFeatureFilterModel::displayExpressionChanged ( )
signal

The display expression will be used for.

  • displaying values in the combobox
  • filtering based on filterValue
void QgsFeatureFilterModel::endUpdate ( )
signal

Notification that the model change is finished.

Will always be emitted in sync with beginUpdate.

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.

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.

int QgsFeatureFilterModel::extraIdentifierValueIndex ( ) const

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

void QgsFeatureFilterModel::extraIdentifierValueIndexChanged ( int  index)
signal

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

bool QgsFeatureFilterModel::extraValueDoesNotExist ( ) const

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

Definition at line 492 of file qgsfeaturefiltermodel.cpp.

void QgsFeatureFilterModel::extraValueDoesNotExistChanged ( )
signal

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

QString QgsFeatureFilterModel::filterExpression ( ) const

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

Can be used for spatial filtering etc.

void QgsFeatureFilterModel::filterExpressionChanged ( )
signal

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

Can be used for spatial filtering etc.

void QgsFeatureFilterModel::filterJobCompleted ( )
signal

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

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.

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.

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.

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.

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

Definition at line 104 of file qgsfeaturefiltermodel.cpp.

bool QgsFeatureFilterModel::isLoading ( ) const

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

void QgsFeatureFilterModel::isLoadingChanged ( )
signal

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

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

Definition at line 110 of file qgsfeaturefiltermodel.cpp.

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

Definition at line 116 of file qgsfeaturefiltermodel.cpp.

void QgsFeatureFilterModel::setAllowNull ( bool  allowNull)

Add a NULL entry to the list.

Definition at line 481 of file qgsfeaturefiltermodel.cpp.

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 59 of file qgsfeaturefiltermodel.cpp.

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 535 of file qgsfeaturefiltermodel.cpp.

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 89 of file qgsfeaturefiltermodel.cpp.

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 74 of file qgsfeaturefiltermodel.cpp.

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 516 of file qgsfeaturefiltermodel.cpp.

void QgsFeatureFilterModel::setSourceLayer ( QgsVectorLayer sourceLayer)

The source layer from which features will be fetched.

Definition at line 43 of file qgsfeaturefiltermodel.cpp.

QgsVectorLayer* QgsFeatureFilterModel::sourceLayer ( ) const

The source layer from which features will be fetched.

void QgsFeatureFilterModel::sourceLayerChanged ( )
signal

The source layer from which features will be fetched.

Friends And Related Function Documentation

friend class QgsFieldExpressionValuesGatherer
friend

Definition at line 308 of file qgsfeaturefiltermodel.h.

Property Documentation

bool QgsFeatureFilterModel::allowNull
readwrite

Definition at line 40 of file qgsfeaturefiltermodel.h.

QString QgsFeatureFilterModel::displayExpression
readwrite

Definition at line 37 of file qgsfeaturefiltermodel.h.

QVariant QgsFeatureFilterModel::extraIdentifierValue
readwrite

The value that identifies the current feature.

Definition at line 53 of file qgsfeaturefiltermodel.h.

int QgsFeatureFilterModel::extraIdentifierValueIndex
read

Definition at line 55 of file qgsfeaturefiltermodel.h.

QString QgsFeatureFilterModel::filterExpression
readwrite

Definition at line 39 of file qgsfeaturefiltermodel.h.

QString QgsFeatureFilterModel::filterValue
readwrite

Definition at line 38 of file qgsfeaturefiltermodel.h.

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.

bool QgsFeatureFilterModel::isLoading
read

Definition at line 41 of file qgsfeaturefiltermodel.h.

QgsVectorLayer * QgsFeatureFilterModel::sourceLayer
readwrite

Definition at line 36 of file qgsfeaturefiltermodel.h.


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