QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Provides a list of features based on filter conditions. More...
#include <qgsfeaturepickermodelbase.h>
Public Types | |
enum | Role { IdentifierValueRole = Qt::UserRole, IdentifierValuesRole, ValueRole, FeatureRole, FeatureIdRole } |
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 | fetchGeometryChanged () |
Emitted when the fetching of the geometry changes. More... | |
void | fetchLimitChanged () |
Emitted when the fetching limit for the feature request changes. 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 | 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 | |
QgsFeaturePickerModelBase (QObject *parent=nullptr) | |
Create a new QgsFeaturePickerModelBase, optionally specifying a parent. More... | |
~QgsFeaturePickerModelBase () 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... | |
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... | |
bool | fetchGeometry () const |
Returns if the geometry is fetched. More... | |
int | fetchLimit () const |
Returns the feature request fetch limit. 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... | |
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... | |
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). More... | |
void | setFetchGeometry (bool fetchGeometry) |
Defines if the geometry will be fetched. More... | |
void | setFetchLimit (int fetchLimit) |
Defines the feature request fetch limit If set to 0, no limit is applied when fetching. 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 | 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... | |
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. More... | |
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. More... | |
virtual QgsFeatureExpressionValuesGatherer * | createValuesGatherer (const QgsFeatureRequest &request) const =0 |
Creates the value gatherer. More... | |
virtual QVariant | entryIdentifier (const QgsFeatureExpressionValuesGatherer::Entry &entry) const =0 |
Returns the identifier of the given entry. 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... | |
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. More... | |
virtual QVariant | nullIdentifier () const =0 |
Returns a null identifier. More... | |
virtual QSet< QString > | requestedAttributes () const |
Returns the attributes to be fetched in the request. More... | |
virtual void | requestToReloadCurrentFeature (QgsFeatureRequest &request)=0 |
Update the request to match the current feature to be reloaded. 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 | 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. More... | |
Protected Attributes | |
QVector< QgsFeatureExpressionValuesGatherer::Entry > | mEntries |
QVariant | mExtraIdentifierValue |
The current identifier value. More... | |
int | mExtraValueIndex = -1 |
The current index. More... | |
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 30 of file qgsfeaturepickermodelbase.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. |
FeatureRole | Used to retrieve the feature, it might be incomplete if the request doesn't fetch all attributes or geometry. |
FeatureIdRole | Used to retrieve the id of a feature. |
Definition at line 48 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 34 of file qgsfeaturepickermodelbase.cpp.
bool QgsFeaturePickerModelBase::allowNull | ( | ) | const |
Add a NULL entry to the list.
Definition at line 556 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 106 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.
|
override |
Definition at line 145 of file qgsfeaturepickermodelbase.cpp.
QString QgsFeaturePickerModelBase::displayExpression | ( | ) | const |
The display expression will be used for.
Definition at line 61 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 117 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 618 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 602 of file qgsfeaturepickermodelbase.cpp.
|
signal |
Flag indicating that the extraIdentifierValue does not exist in the data.
bool QgsFeaturePickerModelBase::fetchGeometry | ( | ) | const |
Returns if the geometry is fetched.
Definition at line 573 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 587 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 95 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 78 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.
|
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 123 of file qgsfeaturepickermodelbase.cpp.
bool QgsFeaturePickerModelBase::isLoading | ( | ) | const |
Indicator if the model is currently performing any feature iteration in the background.
Definition at line 112 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 130 of file qgsfeaturepickermodelbase.cpp.
|
inlineprotectedvirtual |
Returns the attributes to be fetched in the request.
Returns an empty set if all attributes should be fetched.
Definition at line 287 of file qgsfeaturepickermodelbase.h.
|
protectedpure virtual |
Update the request to match the current feature to be reloaded.
|
override |
Definition at line 137 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setAllowNull | ( | bool | allowNull | ) |
Add a NULL entry to the list.
Definition at line 562 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setDisplayExpression | ( | const QString & | displayExpression | ) |
The display expression will be used for.
Definition at line 67 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 630 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 QgsFeaturePickerModel, and QgsFeatureFilterModel.
|
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 487 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setFetchGeometry | ( | bool | fetchGeometry | ) |
Defines if the geometry will be fetched.
Definition at line 578 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 592 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 101 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 84 of file qgsfeaturepickermodelbase.cpp.
void QgsFeaturePickerModelBase::setSourceLayer | ( | QgsVectorLayer * | sourceLayer | ) |
The source layer from which features will be fetched.
Definition at line 47 of file qgsfeaturepickermodelbase.cpp.
QgsVectorLayer * QgsFeaturePickerModelBase::sourceLayer | ( | ) | const |
The source layer from which features will be fetched.
Definition at line 41 of file qgsfeaturepickermodelbase.cpp.
|
signal |
The source layer from which features will be fetched.
|
friend |
Definition at line 347 of file qgsfeaturepickermodelbase.h.
|
protected |
Definition at line 310 of file qgsfeaturepickermodelbase.h.
|
protected |
The current identifier value.
Definition at line 314 of file qgsfeaturepickermodelbase.h.
|
protected |
The current index.
Definition at line 317 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 1 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 1 of file qgsfeaturepickermodelbase.h.
|
read |
Definition at line 1 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 1 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 1 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 1 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 1 of file qgsfeaturepickermodelbase.h.
|
readwrite |
Definition at line 1 of file qgsfeaturepickermodelbase.h.