QGIS API Documentation
3.10.0-A Coruña (6c816b4204)
|
Provides a list of features based on filter conditions. More...
#include <qgsfeaturefiltermodel.h>
Public Types | |
enum | Role { IdentifierValueRole = Qt::UserRole, IdentifierValuesRole, 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... | |
Q_DECL_DEPRECATED 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... | |
QVariantList | extraIdentifierValues () const |
Allows specifying one value that does not need to match the filter criteria but will still be available in 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... | |
Q_DECL_DEPRECATED QString | identifierField () const |
The identifier field should be a unique field that can be used to identify individual features. More... | |
QStringList | identifierFields () 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... | |
Q_DECL_DEPRECATED 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 | setExtraIdentifierValues (const QVariantList &extraIdentifierValues) |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model. More... | |
void | setExtraIdentifierValuesToNull () |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model as NULL value(s). 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... | |
Q_DECL_DEPRECATED void | setIdentifierField (const QString &identifierField) |
The identifier field should be a unique field that can be used to identify individual features. More... | |
void | setIdentifierFields (const QStringList &identifierFields) |
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... | |
QgsVectorLayer * | sourceLayer () 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 |
Provides a list of features based on filter conditions.
Features are fetched asynchronously.
Definition at line 31 of file qgsfeaturefiltermodel.h.
Extra roles that can be used to fetch data from this model.
Enumerator | |
---|---|
IdentifierValueRole |
|
IdentifierValuesRole | Used to retrieve the identifierValues (primary keys) of a feature. |
ValueRole | Used to retrieve the displayExpression of a feature. |
Definition at line 61 of file qgsfeaturefiltermodel.h.
|
explicit |
Create a new QgsFeatureFilterModel, optionally specifying a parent.
Definition at line 37 of file qgsfeaturefiltermodel.cpp.
|
override |
Definition at line 46 of file qgsfeaturefiltermodel.cpp.
bool QgsFeatureFilterModel::allowNull | ( | ) | const |
Add a NULL entry to the list.
|
signal |
Add a NULL entry to the list.
|
signal |
Notification that the model is about to be changed because a job was completed.
|
override |
Definition at line 142 of file qgsfeaturefiltermodel.cpp.
|
override |
Definition at line 148 of file qgsfeaturefiltermodel.cpp.
QString QgsFeatureFilterModel::displayExpression | ( | ) | const |
The display expression will be used for.
|
signal |
The display expression will be used for.
|
signal |
Notification that the model change is finished.
Will always be emitted in sync with beginUpdate.
Q_DECL_DEPRECATED 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.
|
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.
|
signal |
The index at which the extra identifier value is available within the model.
QVariantList QgsFeatureFilterModel::extraIdentifierValues | ( | ) | const |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model.
Definition at line 600 of file qgsfeaturefiltermodel.cpp.
bool QgsFeatureFilterModel::extraValueDoesNotExist | ( | ) | const |
Flag indicating that the extraIdentifierValue does not exist in the data.
Definition at line 548 of file qgsfeaturefiltermodel.cpp.
|
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.
|
signal |
An additional filter expression to apply, next to the filterValue.
Can be used for spatial filtering etc.
|
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.
|
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.
Q_DECL_DEPRECATED 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. If there are several identifier fields defined, the behavior is not guaranteed
|
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.
QStringList QgsFeatureFilterModel::identifierFields | ( | ) | 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.
Definition at line 567 of file qgsfeaturefiltermodel.cpp.
|
override |
Definition at line 123 of file qgsfeaturefiltermodel.cpp.
bool QgsFeatureFilterModel::isLoading | ( | ) | const |
Indicator if the model is currently performing any feature iteration in the background.
|
signal |
Indicator if the model is currently performing any feature iteration in the background.
|
override |
Definition at line 129 of file qgsfeaturefiltermodel.cpp.
|
override |
Definition at line 135 of file qgsfeaturefiltermodel.cpp.
void QgsFeatureFilterModel::setAllowNull | ( | bool | allowNull | ) |
Add a NULL entry to the list.
Definition at line 537 of file qgsfeaturefiltermodel.cpp.
void QgsFeatureFilterModel::setDisplayExpression | ( | const QString & | displayExpression | ) |
The display expression will be used for.
Definition at line 73 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 612 of file qgsfeaturefiltermodel.cpp.
void QgsFeatureFilterModel::setExtraIdentifierValues | ( | const QVariantList & | extraIdentifierValues | ) |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model.
Definition at line 620 of file qgsfeaturefiltermodel.cpp.
void QgsFeatureFilterModel::setExtraIdentifierValuesToNull | ( | ) |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model as NULL value(s).
Definition at line 639 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 103 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 88 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 572 of file qgsfeaturefiltermodel.cpp.
void QgsFeatureFilterModel::setIdentifierFields | ( | const QStringList & | identifierFields | ) |
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 577 of file qgsfeaturefiltermodel.cpp.
void QgsFeatureFilterModel::setSourceLayer | ( | QgsVectorLayer * | sourceLayer | ) |
The source layer from which features will be fetched.
Definition at line 57 of file qgsfeaturefiltermodel.cpp.
QgsVectorLayer* QgsFeatureFilterModel::sourceLayer | ( | ) | const |
The source layer from which features will be fetched.
|
signal |
The source layer from which features will be fetched.
|
friend |
Definition at line 349 of file qgsfeaturefiltermodel.h.
|
readwrite |
Definition at line 39 of file qgsfeaturefiltermodel.h.
|
readwrite |
Definition at line 36 of file qgsfeaturefiltermodel.h.
|
readwrite |
The value that identifies the current feature.
Definition at line 52 of file qgsfeaturefiltermodel.h.
|
read |
Definition at line 54 of file qgsfeaturefiltermodel.h.
|
readwrite |
Definition at line 38 of file qgsfeaturefiltermodel.h.
|
readwrite |
Definition at line 37 of file qgsfeaturefiltermodel.h.
|
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 47 of file qgsfeaturefiltermodel.h.
|
read |
Definition at line 40 of file qgsfeaturefiltermodel.h.
|
readwrite |
Definition at line 35 of file qgsfeaturefiltermodel.h.