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

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:

rowCount

param parent:

setAllowNull

Add a NULL entry to the list.

setDisplayExpression

The display expression will be used for

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

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

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

beginUpdate

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

currentFeatureChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

displayExpressionChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

endUpdate

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

extraIdentifierValueChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

extraIdentifierValueIndexChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

extraValueDoesNotExistChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

fetchGeometryChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

fetchLimitChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

filterExpressionChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

filterJobCompleted

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

filterValueChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

isLoadingChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

sourceLayerChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

beginUpdate

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

columnCount(self, parent: QModelIndex) int
Parameters:

parent (QModelIndex) –

Return type:

int

currentFeatureChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

endUpdate

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

extraIdentifierValueChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

extraIdentifierValueIndex(self) int

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

Return type:

int

extraIdentifierValueIndexChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

extraValueDoesNotExist(self) bool

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

Return type:

bool

extraValueDoesNotExistChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

fetchGeometry(self) bool

Returns if the geometry is fetched

Return type:

bool

fetchGeometryChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

fetchLimit(self) int

Returns the feature request fetch limit

Return type:

int

fetchLimitChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

filterJobCompleted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

parent(self, child: QModelIndex) QModelIndex
Parameters:

child (QModelIndex) –

Return type:

QModelIndex

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

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

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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL