|
QGIS API Documentation 3.99.0-Master (2fe06baccd8)
|
Provides a list of features based on filter conditions. More...
#include <qgsfeaturepickermodelbase.h>

Public Types | |
| enum class | CustomRole : int { IdentifierValue = Qt::UserRole , IdentifierValues , Value , Feature , FeatureId } |
| Extra roles that can be used to fetch data from this model. More... | |
Signals | |
| void | allowNullChanged () |
| Add a NULL entry to the list. | |
| void | beginUpdate () |
| Notification that the model is about to be changed because a job was completed. | |
| void | currentFeatureChanged () |
| Emitted when the current feature in the model has changed This emitted both when the extra value changes and when the extra value status changes. | |
| void | displayExpressionChanged () |
| The display expression will be used for. | |
| void | endUpdate () |
| Notification that the model change is finished. | |
| void | extraIdentifierValueChanged () |
| Allows specifying one value that does not need to match the filter criteria but will still be available in the model. | |
| void | extraIdentifierValueIndexChanged (int index) |
| The index at which the extra identifier value is available within the model. | |
| void | extraValueDoesNotExistChanged (bool found) |
| Notification whether the model has found a feature tied to the extraIdentifierValue or not. | |
| void | fetchGeometryChanged () |
| Emitted when the fetching of the geometry changes. | |
| void | fetchLimitChanged () |
| Emitted when the fetching limit for the feature request changes. | |
| void | filterExpressionChanged () |
| An additional filter expression to apply, next to the filterValue. | |
| void | filterJobCompleted () |
| Indicates that a filter job has been completed and new data may be available. | |
| void | filterValueChanged () |
| This value will be used to filter the features available from this model. | |
| void | formFeatureChanged () |
| An attribute form feature to be used alongside the filter expression. | |
| void | isLoadingChanged () |
| Indicator if the model is currently performing any feature iteration in the background. | |
| void | orderExpressionChanged () |
| An expression for generating values for sorting. | |
| void | parentFormFeatureChanged () |
| A parent attribute form feature to be used alongside the filter expression. | |
| void | sortOrderChanged () |
| The direction used for sorting. | |
| void | sourceLayerChanged () |
| The source layer from which features will be fetched. | |
Public Member Functions | |
| QgsFeaturePickerModelBase (QObject *parent=nullptr) | |
| Create a new QgsFeaturePickerModelBase, optionally specifying a parent. | |
| ~QgsFeaturePickerModelBase () override | |
| bool | allowNull () const |
| Add a NULL entry to the list. | |
| 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. | |
| int | extraIdentifierValueIndex () const |
| The index at which the extra identifier value is available within the model. | |
| bool | extraValueDoesNotExist () const |
| Flag indicating that the extraIdentifierValue does not exist in the data. | |
| bool | fetchGeometry () const |
| Returns if the geometry is fetched. | |
| int | fetchLimit () const |
| Returns the feature request fetch limit. | |
| QString | filterExpression () const |
| An additional filter expression to apply, next to the filterValue. | |
| QString | filterValue () const |
| This value will be used to filter the features available from this model. | |
| QgsFeature | formFeature () const |
| Returns an attribute form feature to be used with the filter expression. | |
| 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. | |
| QString | orderExpression () const |
| The order expression will be used for sort values in the combobox. | |
| QModelIndex | parent (const QModelIndex &child) const override |
| QgsFeature | parentFormFeature () const |
| Returns a parent attribute form feature to be used with the filter expression. | |
| int | rowCount (const QModelIndex &parent) const override |
| void | setAllowNull (bool allowNull) |
| Add a NULL entry to the list. | |
| void | setDisplayExpression (const QString &displayExpression) |
| The display expression will be used for. | |
| virtual void | setExtraIdentifierValueToNull ()=0 |
| 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). | |
| void | setFetchGeometry (bool fetchGeometry) |
| Defines if the geometry will be fetched. | |
| void | setFetchLimit (int fetchLimit) |
| Defines the feature request fetch limit If set to 0, no limit is applied when fetching. | |
| void | setFilterExpression (const QString &filterExpression) |
| An additional filter expression to apply, next to the filterValue. | |
| void | setFilterValue (const QString &filterValue) |
| This value will be used to filter the features available from this model. | |
| void | setFormFeature (const QgsFeature &feature) |
| Sets an attribute form feature to be used with the filter expression. | |
| void | setOrderExpression (const QString &orderExpression) |
| The order expression will be used for sort values in the combobox. | |
| void | setParentFormFeature (const QgsFeature &feature) |
| Sets a parent attribute form feature to be used with the filter expression. | |
| void | setSortOrder (const Qt::SortOrder sortOrder) |
| The order direction will be used for sort values in the combobox. | |
| void | setSourceLayer (QgsVectorLayer *sourceLayer) |
| The source layer from which features will be fetched. | |
| Qt::SortOrder | sortOrder () const |
| The order direction will be used for sort values in the combobox. | |
| QgsVectorLayer * | sourceLayer () const |
| The source layer from which features will be fetched. | |
Protected Member Functions | |
| virtual bool | compareEntries (const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b) const =0 |
Returns true if the 2 entries refers to the same feature. | |
| virtual QgsFeatureExpressionValuesGatherer::Entry | createEntry (const QVariant &identifier) const =0 |
| Creates an entry with just the identifier so the feature can be retrieved in a next iteration. | |
| virtual QgsFeatureExpressionValuesGatherer * | createValuesGatherer (const QgsFeatureRequest &request) const =0 |
| Creates the value gatherer. | |
| virtual QVariant | entryIdentifier (const QgsFeatureExpressionValuesGatherer::Entry &entry) const =0 |
| Returns the identifier of the given entry. | |
| QVariant | extraIdentifierValue () const |
| Allows specifying one value that does not need to match the filter criteria but will still be available in the model. | |
| virtual bool | identifierIsNull (const QVariant &identifier) const =0 |
Returns true if the entry is null The identifier can be either the feature ID or the list of identifier fields. | |
| virtual QVariant | nullIdentifier () const =0 |
| Returns a null identifier. | |
| virtual QSet< QString > | requestedAttributes () const |
| Returns the attributes to be fetched in the request. | |
| virtual void | requestToReloadCurrentFeature (QgsFeatureRequest &request)=0 |
| Update the request to match the current feature to be reloaded. | |
| 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. | |
| void | setExtraIdentifierValueUnguarded (const QVariant &identifierValue) |
| This will set the identifier value to be set in the model even if it doesn't exist currently in the data. | |
Protected Attributes | |
| QVector< QgsFeatureExpressionValuesGatherer::Entry > | mEntries |
| QVariant | mExtraIdentifierValue |
| The current identifier value. | |
| int | mExtraValueIndex = -1 |
| The current index. | |
Properties | |
| bool | allowNull |
| QString | displayExpression |
| int | extraIdentifierValueIndex |
| bool | fetchGeometry |
| int | fetchLimit |
| QString | filterExpression |
| QString | filterValue |
| QString | orderExpression |
| Qt::SortOrder | sortOrder |
| QgsVectorLayer * | sourceLayer |
Friends | |
| class | TestQgsFeatureListComboBox |
Provides a list of features based on filter conditions.
Features are fetched asynchronously.
Definition at line 32 of file qgsfeaturepickermodelbase.h.
|
strong |
Extra roles that can be used to fetch data from this model.
| Enumerator | |
|---|---|
| IdentifierValue | Used to retrieve the identifier value (primary key) of a feature.
|
| IdentifierValues | Used to retrieve the identifierValues (primary keys) of a feature. |
| Value | Used to retrieve the displayExpression of a feature. |
| Feature | Used to retrieve the feature, it might be incomplete if the request doesn't fetch all attributes or geometry. |
| FeatureId | Used to retrieve the id of a feature. |
Definition at line 57 of file qgsfeaturepickermodelbase.h.
|
explicit |
Create a new QgsFeaturePickerModelBase, optionally specifying a parent.
Definition at line 26 of file qgsfeaturepickermodelbase.cpp.
|
override |
Definition at line 39 of file qgsfeaturepickermodelbase.cpp.
| bool QgsFeaturePickerModelBase::allowNull | ( | ) | const |
Add a NULL entry to the list.
Definition at line 627 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Add a NULL entry to the list.
|
signal |
Notification that the model is about to be changed because a job was completed.
|
inlineoverride |
Definition at line 117 of file qgsfeaturepickermodelbase.h.
|
protectedpure virtual |
Returns true if the 2 entries refers to the same feature.
|
protectedpure virtual |
Creates an entry with just the identifier so the feature can be retrieved in a next iteration.
|
protectedpure virtual |
Creates the value gatherer.
|
signal |
Emitted when the current feature in the model has changed This emitted both when the extra value changes and when the extra value status changes.
It allows being notified when the feature is fetched after the extra value has been set.
|
override |
Definition at line 188 of file qgsfeaturepickermodelbase.cpp.
| QString QgsFeaturePickerModelBase::displayExpression | ( | ) | const |
The display expression will be used for.
Definition at line 69 of file qgsfeaturepickermodelbase.cpp.
|
signal |
The display expression will be used for.
|
signal |
Notification that the model change is finished.
Will always be emitted in sync with beginUpdate.
|
protectedpure virtual |
Returns the identifier of the given entry.
|
protected |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model.
Definition at line 160 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model.
| int QgsFeaturePickerModelBase::extraIdentifierValueIndex | ( | ) | const |
The index at which the extra identifier value is available within the model.
Definition at line 691 of file qgsfeaturepickermodelbase.cpp.
|
signal |
The index at which the extra identifier value is available within the model.
| bool QgsFeaturePickerModelBase::extraValueDoesNotExist | ( | ) | const |
Flag indicating that the extraIdentifierValue does not exist in the data.
Definition at line 675 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Notification whether the model has found a feature tied to the extraIdentifierValue or not.
| bool QgsFeaturePickerModelBase::fetchGeometry | ( | ) | const |
Returns if the geometry is fetched.
Definition at line 644 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Emitted when the fetching of the geometry changes.
| int QgsFeaturePickerModelBase::fetchLimit | ( | ) | const |
Returns the feature request fetch limit.
Definition at line 658 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Emitted when the fetching limit for the feature request changes.
| QString QgsFeaturePickerModelBase::filterExpression | ( | ) | const |
An additional filter expression to apply, next to the filterValue.
Can be used for spatial filtering etc.
Definition at line 103 of file qgsfeaturepickermodelbase.cpp.
|
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 QgsFeaturePickerModelBase::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.
Definition at line 86 of file qgsfeaturepickermodelbase.cpp.
|
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.
| QgsFeature QgsFeaturePickerModelBase::formFeature | ( | ) | const |
Returns an attribute form feature to be used with the filter expression.
Definition at line 119 of file qgsfeaturepickermodelbase.cpp.
|
signal |
An attribute form feature to be used alongside the filter expression.
|
protectedpure virtual |
Returns true if the entry is null The identifier can be either the feature ID or the list of identifier fields.
|
override |
Definition at line 166 of file qgsfeaturepickermodelbase.cpp.
| bool QgsFeaturePickerModelBase::isLoading | ( | ) | const |
Indicator if the model is currently performing any feature iteration in the background.
Definition at line 155 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Indicator if the model is currently performing any feature iteration in the background.
|
protectedpure virtual |
Returns a null identifier.
| QString QgsFeaturePickerModelBase::orderExpression | ( | ) | const |
The order expression will be used for sort values in the combobox.
Definition at line 723 of file qgsfeaturepickermodelbase.cpp.
|
signal |
An expression for generating values for sorting.
Can be used for combo boxes etc.
|
override |
Definition at line 173 of file qgsfeaturepickermodelbase.cpp.
| QgsFeature QgsFeaturePickerModelBase::parentFormFeature | ( | ) | const |
Returns a parent attribute form feature to be used with the filter expression.
Definition at line 137 of file qgsfeaturepickermodelbase.cpp.
|
signal |
A parent attribute form feature to be used alongside the filter expression.
|
inlineprotectedvirtual |
Returns the attributes to be fetched in the request.
Returns an empty set if all attributes should be fetched.
Definition at line 381 of file qgsfeaturepickermodelbase.h.
|
protectedpure virtual |
Update the request to match the current feature to be reloaded.
|
override |
Definition at line 180 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setAllowNull | ( | bool | allowNull | ) |
Add a NULL entry to the list.
Definition at line 633 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setDisplayExpression | ( | const QString & | displayExpression | ) |
The display expression will be used for.
Definition at line 75 of file qgsfeaturepickermodelbase.cpp.
|
protected |
Allows specifying one value that does not need to match the filter criteria but will still be available in the model.
Definition at line 703 of file qgsfeaturepickermodelbase.cpp.
|
pure virtual |
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).
Implemented in QgsFeatureFilterModel, and QgsFeaturePickerModel.
|
protected |
This will set the identifier value to be set in the model even if it doesn't exist currently in the data.
Definition at line 556 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setFetchGeometry | ( | bool | fetchGeometry | ) |
Defines if the geometry will be fetched.
Definition at line 649 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setFetchLimit | ( | int | fetchLimit | ) |
Defines the feature request fetch limit If set to 0, no limit is applied when fetching.
Definition at line 663 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setFilterExpression | ( | const QString & | filterExpression | ) |
An additional filter expression to apply, next to the filterValue.
Can be used for spatial filtering etc.
Definition at line 109 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::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 92 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setFormFeature | ( | const QgsFeature & | feature | ) |
Sets an attribute form feature to be used with the filter expression.
Definition at line 124 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setOrderExpression | ( | const QString & | orderExpression | ) |
The order expression will be used for sort values in the combobox.
Definition at line 729 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setParentFormFeature | ( | const QgsFeature & | feature | ) |
Sets a parent attribute form feature to be used with the filter expression.
Definition at line 142 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setSortOrder | ( | const Qt::SortOrder | sortOrder | ) |
The order direction will be used for sort values in the combobox.
Ascending or descending.
Definition at line 746 of file qgsfeaturepickermodelbase.cpp.
| void QgsFeaturePickerModelBase::setSourceLayer | ( | QgsVectorLayer * | sourceLayer | ) |
The source layer from which features will be fetched.
Definition at line 52 of file qgsfeaturepickermodelbase.cpp.
| Qt::SortOrder QgsFeaturePickerModelBase::sortOrder | ( | ) | const |
The order direction will be used for sort values in the combobox.
Ascending or descending.
Definition at line 740 of file qgsfeaturepickermodelbase.cpp.
|
signal |
The direction used for sorting.
Can be used for combo boxes etc.
| QgsVectorLayer * QgsFeaturePickerModelBase::sourceLayer | ( | ) | const |
The source layer from which features will be fetched.
Definition at line 46 of file qgsfeaturepickermodelbase.cpp.
|
signal |
The source layer from which features will be fetched.
|
friend |
Definition at line 446 of file qgsfeaturepickermodelbase.h.
|
protected |
Definition at line 404 of file qgsfeaturepickermodelbase.h.
|
protected |
The current identifier value.
Definition at line 408 of file qgsfeaturepickermodelbase.h.
|
protected |
The current index.
Definition at line 411 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 42 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 37 of file qgsfeaturepickermodelbase.h.
|
read |
Definition at line 45 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 43 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 44 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 39 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 38 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 40 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 41 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 36 of file qgsfeaturepickermodelbase.h.