QGIS API Documentation 3.43.0-Master (37eec98dbf6)
|
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 | parentFormFeatureChanged () |
A parent attribute form feature to be used alongside the filter expression. | |
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. | |
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 | setParentFormFeature (const QgsFeature &feature) |
Sets a parent attribute form feature to be used with the filter expression. | |
void | setSourceLayer (QgsVectorLayer *sourceLayer) |
The source layer from which features will be fetched. | |
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 |
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 55 of file qgsfeaturepickermodelbase.h.
|
explicit |
Create a new QgsFeaturePickerModelBase, optionally specifying a parent.
Definition at line 25 of file qgsfeaturepickermodelbase.cpp.
|
override |
Definition at line 38 of file qgsfeaturepickermodelbase.cpp.
bool QgsFeaturePickerModelBase::allowNull | ( | ) | const |
Add a NULL entry to the list.
Definition at line 598 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 115 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 187 of file qgsfeaturepickermodelbase.cpp.
QString QgsFeaturePickerModelBase::displayExpression | ( | ) | const |
The display expression will be used for.
Definition at line 68 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 159 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 662 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 646 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 615 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 629 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 102 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 85 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 118 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 165 of file qgsfeaturepickermodelbase.cpp.
bool QgsFeaturePickerModelBase::isLoading | ( | ) | const |
Indicator if the model is currently performing any feature iteration in the background.
Definition at line 154 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Indicator if the model is currently performing any feature iteration in the background.
|
protectedpure virtual |
Returns a null identifier.
|
override |
Definition at line 172 of file qgsfeaturepickermodelbase.cpp.
QgsFeature QgsFeaturePickerModelBase::parentFormFeature | ( | ) | const |
Returns a parent attribute form feature to be used with the filter expression.
Definition at line 136 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 340 of file qgsfeaturepickermodelbase.h.
|
protectedpure virtual |
Update the request to match the current feature to be reloaded.
|
override |
Definition at line 179 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setAllowNull | ( | bool | allowNull | ) |
Add a NULL entry to the list.
Definition at line 604 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setDisplayExpression | ( | const QString & | displayExpression | ) |
The display expression will be used for.
Definition at line 74 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 674 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 527 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setFetchGeometry | ( | bool | fetchGeometry | ) |
Defines if the geometry will be fetched.
Definition at line 620 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 634 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 108 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 91 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 123 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 141 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setSourceLayer | ( | QgsVectorLayer * | sourceLayer | ) |
The source layer from which features will be fetched.
Definition at line 51 of file qgsfeaturepickermodelbase.cpp.
QgsVectorLayer * QgsFeaturePickerModelBase::sourceLayer | ( | ) | const |
The source layer from which features will be fetched.
Definition at line 45 of file qgsfeaturepickermodelbase.cpp.
|
signal |
The source layer from which features will be fetched.
|
friend |
Definition at line 403 of file qgsfeaturepickermodelbase.h.
|
protected |
Definition at line 363 of file qgsfeaturepickermodelbase.h.
|
protected |
The current identifier value.
Definition at line 367 of file qgsfeaturepickermodelbase.h.
|
protected |
The current index.
Definition at line 370 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 40 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 37 of file qgsfeaturepickermodelbase.h.
|
read |
Definition at line 43 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 41 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 42 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 36 of file qgsfeaturepickermodelbase.h.