Class: QgsFeaturePickerModelBase

class qgis.core.QgsFeaturePickerModelBase

Bases: PyQt5.QtCore.QAbstractItemModel

Provides a list of features based on filter conditions.

Features are fetched asynchronously.

New in version 3.14.

QgsFeaturePickerModelBase(parent: QObject = None) Create a new QgsFeaturePickerModelBase, optionally specifying a parent.

Methods

allowNull

Add a NULL entry to the list.

columnCount

param parent

data

param index

displayExpression

The display expression will be used for

extraIdentifierValue

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

extraIdentifierValueIndex

The index at which the extra identifier value is available within the model.

extraValueDoesNotExist

Flag indicating that the extraIdentifierValue does not exist in the data.

fetchGeometry

Returns if the geometry is fetched

fetchLimit

Returns the feature request fetch limit

filterExpression

An additional filter expression to apply, next to the filterValue.

filterValue

This value will be used to filter the features available from this model.

index

param row

isLoading

Indicator if the model is currently performing any feature iteration in the background.

parent

param child

requestToReloadCurrentFeature

Update the request to match the current feature to be reloaded

rowCount

param parent

setAllowNull

Add a NULL entry to the list.

setDisplayExpression

The display expression will be used for

setExtraIdentifierValue

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

setExtraIdentifierValueToNull

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).

setExtraIdentifierValueUnguarded

This will set the identifier value to be set in the model even if it doesn't exist currently in the data

setFetchGeometry

Defines if the geometry will be fetched

setFetchLimit

Defines the feature request fetch limit If set to 0, no limit is applied when fetching

setFilterExpression

An additional filter expression to apply, next to the filterValue.

setFilterValue

This value will be used to filter the features available from this model.

setSourceLayer

The source layer from which features will be fetched.

sourceLayer

The source layer from which features will be fetched.

Signals

allowNullChanged

Add a NULL entry to the list.

beginUpdate

Notification that the model is about to be changed because a job was completed.

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.

displayExpressionChanged

The display expression will be used for

endUpdate

Notification that the model change is finished.

extraIdentifierValueChanged

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

extraIdentifierValueIndexChanged

The index at which the extra identifier value is available within the model.

extraValueDoesNotExistChanged

Flag indicating that the extraIdentifierValue does not exist in the data.

fetchGeometryChanged

Emitted when the fetching of the geometry changes [signal]

fetchLimitChanged

Emitted when the fetching limit for the feature request changes [signal]

filterExpressionChanged

An additional filter expression to apply, next to the filterValue.

filterJobCompleted

Indicates that a filter job has been completed and new data may be available.

filterValueChanged

This value will be used to filter the features available from this model.

isLoadingChanged

Indicator if the model is currently performing any feature iteration in the background.

sourceLayerChanged

The source layer from which features will be fetched.

Attributes

FeatureIdRole

FeatureRole

IdentifierValueRole

IdentifierValuesRole

ValueRole

FeatureIdRole = 260
FeatureRole = 259
IdentifierValueRole = 256
IdentifierValuesRole = 257
class Role

Bases: int

ValueRole = 258
allowNull(self) bool

Add a NULL entry to the list.

Return type

bool

allowNullChanged

Add a NULL entry to the list. [signal]

beginUpdate

Notification that the model is about to be changed because a job was completed. [signal]

columnCount(self, parent: QModelIndex) int
Parameters

parent (QModelIndex) –

Return type

int

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. It allows being notified when the feature is fetched after the extra value has been set.

New in version 3.16.5: [signal]

data(self, index: QModelIndex, role: int) Any
Parameters
  • index (QModelIndex) –

  • role (int) –

Return type

Any

displayExpression(self) str

The display expression will be used for

  • displaying values in the combobox

  • filtering based on filterValue

Return type

str

displayExpressionChanged

The display expression will be used for

  • displaying values in the combobox

  • filtering based on filterValue [signal]

endUpdate

Notification that the model change is finished. Will always be emitted in sync with beginUpdate. [signal]

extraIdentifierValue(self) Any

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

Return type

Any

extraIdentifierValueChanged

Allows specifying one value that does not need to match the filter criteria but will still be available in the model. [signal]

extraIdentifierValueIndex(self) int

The index at which the extra identifier value is available within the model.

Return type

int

extraIdentifierValueIndexChanged

The index at which the extra identifier value is available within the model. [signal]

Parameters

index (int) –

extraValueDoesNotExist(self) bool

Flag indicating that the extraIdentifierValue does not exist in the data.

Return type

bool

extraValueDoesNotExistChanged

Flag indicating that the extraIdentifierValue does not exist in the data. [signal]

fetchGeometry(self) bool

Returns if the geometry is fetched

Return type

bool

fetchGeometryChanged

Emitted when the fetching of the geometry changes [signal]

fetchLimit(self) int

Returns the feature request fetch limit

Return type

int

fetchLimitChanged

Emitted when the fetching limit for the feature request changes [signal]

filterExpression(self) str

An additional filter expression to apply, next to the filterValue. Can be used for spatial filtering etc.

Return type

str

filterExpressionChanged

An additional filter expression to apply, next to the filterValue. Can be used for spatial filtering etc. [signal]

filterJobCompleted

Indicates that a filter job has been completed and new data may be available. [signal]

filterValue(self) str

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

filterValueChanged

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]

index(self, row: int, column: int, parent: QModelIndex) QModelIndex
Parameters
  • row (int) –

  • column (int) –

  • parent (QModelIndex) –

Return type

QModelIndex

isLoading(self) bool

Indicator if the model is currently performing any feature iteration in the background.

Return type

bool

isLoadingChanged

Indicator if the model is currently performing any feature iteration in the background. [signal]

parent(self, child: QModelIndex) QModelIndex
Parameters

child (QModelIndex) –

Return type

QModelIndex

requestToReloadCurrentFeature(self, request: QgsFeatureRequest)

Update the request to match the current feature to be reloaded

Parameters

request (QgsFeatureRequest) –

rowCount(self, parent: QModelIndex) int
Parameters

parent (QModelIndex) –

Return type

int

setAllowNull(self, allowNull: bool)

Add a NULL entry to the list.

Parameters

allowNull (bool) –

setDisplayExpression(self, displayExpression: str)

The display expression will be used for

  • displaying values in the combobox

  • filtering based on filterValue

Parameters

displayExpression (str) –

setExtraIdentifierValue(self, extraIdentifierValue: Any)

Allows specifying one value that does not need to match the filter criteria but will still be available in the model.

Parameters

extraIdentifierValue (Any) –

setExtraIdentifierValueToNull(self)

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).

setExtraIdentifierValueUnguarded(self, identifierValue: Any)

This will set the identifier value to be set in the model even if it doesn’t exist currently in the data

Parameters

identifierValue (Any) –

setFetchGeometry(self, fetchGeometry: bool)

Defines if the geometry will be fetched

Parameters

fetchGeometry (bool) –

setFetchLimit(self, fetchLimit: int)

Defines the feature request fetch limit If set to 0, no limit is applied when fetching

Parameters

fetchLimit (int) –

setFilterExpression(self, filterExpression: str)

An additional filter expression to apply, next to the filterValue. Can be used for spatial filtering etc.

Parameters

filterExpression (str) –

setFilterValue(self, filterValue: str)

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 (str) –

setSourceLayer(self, sourceLayer: QgsVectorLayer)

The source layer from which features will be fetched.

Parameters

sourceLayer (QgsVectorLayer) –

sourceLayer(self) QgsVectorLayer

The source layer from which features will be fetched.

Return type

QgsVectorLayer

sourceLayerChanged

The source layer from which features will be fetched. [signal]