Class: QgsFeaturePickerModelBase¶
Provides a list of features based on filter conditions.
Features are fetched asynchronously.
Added in version 3.14.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: requestToReloadCurrentFeature()
, setExtraIdentifierValueToNull()
Class Hierarchy¶
Base classes¶
Subclasses¶
Provides a list of features based on filter conditions. |
|
Provides a list of features based on filter conditions. |
Enums
Extra roles that can be used to fetch data from this model. |
|
alias of |
Abstract Methods
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). |
Methods
Add a NULL entry to the list. |
|
The display expression will be used for |
|
The index at which the extra identifier value is available within the model. |
|
Flag indicating that the extraIdentifierValue does not exist in the data. |
|
Returns if the geometry is fetched |
|
Returns the feature request fetch limit |
|
An additional filter expression to apply, next to the filterValue. |
|
This value will be used to filter the features available from this model. |
|
Returns an attribute form feature to be used with the filter expression. |
|
Indicator if the model is currently performing any feature iteration in the background. |
|
Returns a parent attribute form feature to be used with the filter expression. |
|
Add a NULL entry to the list. |
|
The display expression will be used for |
|
Defines if the geometry will be fetched |
|
Defines the feature request fetch limit If set to 0, no limit is applied when fetching |
|
An additional filter expression to apply, next to the filterValue. |
|
This value will be used to filter the features available from this model. |
|
Sets an attribute form feature to be used with the filter expression. |
|
Sets a parent attribute form feature to be used with the filter expression. |
|
The source layer from which features will be fetched. |
|
The source layer from which features will be fetched. |
Signals
Add a NULL entry to the list. |
|
Notification that the model is about to be changed because a job was completed. |
|
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. |
|
The display expression will be used for |
|
Notification that the model change is finished. |
|
Allows specifying one value that does not need to match the filter criteria but will still be available in the model. |
|
The index at which the extra identifier value is available within the model. |
|
Notification whether the model has found a feature tied to the extraIdentifierValue or not. |
|
Emitted when the fetching of the geometry changes |
|
Emitted when the fetching limit for the feature request changes |
|
An additional filter expression to apply, next to the filterValue. |
|
Indicates that a filter job has been completed and new data may be available. |
|
This value will be used to filter the features available from this model. |
|
An attribute form feature to be used alongside the filter expression. |
|
Indicator if the model is currently performing any feature iteration in the background. |
|
A parent attribute form feature to be used alongside the filter expression. |
|
The source layer from which features will be fetched. |
- class qgis.core.QgsFeaturePickerModelBase[source]¶
Bases:
QAbstractItemModel
- __init__(parent: QObject | None = None)
Create a new QgsFeaturePickerModelBase, optionally specifying a
parent
.- Parameters:
parent (Optional[QObject] = None)
- class CustomRole(*values)¶
Bases:
IntEnum
Extra roles that can be used to fetch data from this model.
Note
Prior to QGIS 3.36 this was available as QgsFeaturePickerModelBase.Role
Added in version 3.36.
IdentifierValue
: Used to retrieve the identifier value (primary key) of a feature.Deprecated since version 3.40.: Use IdentifierValuesRole instead.
Available as
QgsFeaturePickerModelBase.IdentifierValueRole
in older QGIS releases.IdentifierValues
: Used to retrieve the identifierValues (primary keys) of a feature.Available as
QgsFeaturePickerModelBase.IdentifierValuesRole
in older QGIS releases.Value
: Used to retrieve the displayExpression of a feature.Available as
QgsFeaturePickerModelBase.ValueRole
in older QGIS releases.Feature
: Used to retrieve the feature, it might be incomplete if the request doesn’t fetch all attributes or geometry.Available as
QgsFeaturePickerModelBase.FeatureRole
in older QGIS releases.FeatureId
: Used to retrieve the id of a feature.Available as
QgsFeaturePickerModelBase.FeatureIdRole
in older QGIS releases.
- Role¶
alias of
CustomRole
- signal beginUpdate[source]¶
Notification that the model is about to be changed because a job was completed.
- signal currentFeatureChanged[source]¶
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.
Added in version 3.16.5.
- displayExpression(self) str [source]¶
The display expression will be used for
displaying values in the combobox
filtering based on filterValue
- Return type:
str
- signal displayExpressionChanged[source]¶
The display expression will be used for
displaying values in the combobox
filtering based on filterValue
- signal endUpdate[source]¶
Notification that the model change is finished. Will always be emitted in sync with beginUpdate.
- signal extraIdentifierValueChanged[source]¶
Allows specifying one value that does not need to match the filter criteria but will still be available in the model.
- extraIdentifierValueIndex(self) int [source]¶
The index at which the extra identifier value is available within the model.
- Return type:
int
- signal extraIdentifierValueIndexChanged(index: int)[source]¶
The index at which the extra identifier value is available within the model.
- Parameters:
index (int)
- extraValueDoesNotExist(self) bool [source]¶
Flag indicating that the extraIdentifierValue does not exist in the data.
- Return type:
bool
- signal extraValueDoesNotExistChanged(found: bool)[source]¶
Notification whether the model has
found
a feature tied to the extraIdentifierValue or not.- Parameters:
found (bool)
- filterExpression(self) str [source]¶
An additional filter expression to apply, next to the filterValue. Can be used for spatial filtering etc.
- Return type:
str
- signal filterExpressionChanged[source]¶
An additional filter expression to apply, next to the filterValue. Can be used for spatial filtering etc.
- signal filterJobCompleted[source]¶
Indicates that a filter job has been completed and new data may be available.
- filterValue(self) str [source]¶
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.
- Return type:
str
- signal filterValueChanged[source]¶
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.
- formFeature(self) QgsFeature [source]¶
Returns an attribute form feature to be used with the filter expression.
Added in version 3.42.2.
- Return type:
- signal formFeatureChanged[source]¶
An attribute form feature to be used alongside the filter expression.
Added in version 3.42.2.
- isLoading(self) bool [source]¶
Indicator if the model is currently performing any feature iteration in the background.
- Return type:
bool
- signal isLoadingChanged[source]¶
Indicator if the model is currently performing any feature iteration in the background.
- parentFormFeature(self) QgsFeature [source]¶
Returns a parent attribute form feature to be used with the filter expression.
Added in version 3.42.2.
- Return type:
- signal parentFormFeatureChanged[source]¶
A parent attribute form feature to be used alongside the filter expression.
Added in version 3.42.2.
- setAllowNull(self, allowNull: bool)[source]¶
Add a NULL entry to the list.
- Parameters:
allowNull (bool)
- setDisplayExpression(self, displayExpression: str | None)[source]¶
The display expression will be used for
displaying values in the combobox
filtering based on filterValue
- Parameters:
displayExpression (Optional[str])
- abstract setExtraIdentifierValueToNull(self)[source]¶
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).
- setFetchGeometry(self, fetchGeometry: bool)[source]¶
Defines if the geometry will be fetched
- Parameters:
fetchGeometry (bool)
- setFetchLimit(self, fetchLimit: int)[source]¶
Defines the feature request fetch limit If set to 0, no limit is applied when fetching
- Parameters:
fetchLimit (int)
- setFilterExpression(self, filterExpression: str | None)[source]¶
An additional filter expression to apply, next to the filterValue. Can be used for spatial filtering etc.
- Parameters:
filterExpression (Optional[str])
- setFilterValue(self, filterValue: str | None)[source]¶
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.
- Parameters:
filterValue (Optional[str])
- setFormFeature(self, feature: QgsFeature)[source]¶
Sets an attribute form
feature
to be used with the filter expression.Added in version 3.42.2.
- Parameters:
feature (QgsFeature)
- setParentFormFeature(self, feature: QgsFeature)[source]¶
Sets a parent attribute form
feature
to be used with the filter expression.Added in version 3.42.2.
- Parameters:
feature (QgsFeature)
- setSourceLayer(self, sourceLayer: QgsVectorLayer | None)[source]¶
The source layer from which features will be fetched.
- Parameters:
sourceLayer (Optional[QgsVectorLayer])
- sourceLayer(self) QgsVectorLayer | None [source]¶
The source layer from which features will be fetched.
- Return type:
Optional[QgsVectorLayer]