Class: QgsFeatureFilterModel

class qgis.core.QgsFeatureFilterModel(parent: QObject = None)

Bases: PyQt5.QtCore.QAbstractItemModel

Create a new QgsFeatureFilterModel, optionally specifying a parent.

Provides a list of features based on filter conditions. Features are fetched asynchronously.

New in version 3.0: Methods

allowNull Add a NULL entry to the list.
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
beginResetModel
changePersistentIndex
changePersistentIndexList
childEvent
columnCount
connectNotify
createIndex
customEvent
data
decodeData
disconnectNotify
displayExpression The display expression will be used for
encodeData
endInsertColumns
endInsertRows
endMoveColumns
endMoveRows
endRemoveColumns
endRemoveRows
endResetModel
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.
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.
identifierField The identifier field should be a unique field that can be used to identify individual features.
index
isLoading Indicator if the model is currently performing any feature iteration in the background.
isSignalConnected
parent
persistentIndexList
receivers
resetInternalData
rowCount
sender
senderSignalIndex
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.
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.
setIdentifierField The identifier field should be a unique field that can be used to identify individual features.
setSourceLayer The source layer from which features will be fetched.
sourceLayer The source layer from which features will be fetched.
timerEvent

Signals

allowNullChanged Add a NULL entry to the list.
beginUpdate Notification that the model is about to be changed because a job was completed.
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.
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.
identifierFieldChanged The identifier field should be a unique field that can be used to identify individual features.
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

IdentifierValueRole
ValueRole
IdentifierValueRole = 256
class Role

Bases: int

ValueRole = 257
allowNull(self) → bool

Add a NULL entry to the list.

allowNullChanged

Add a NULL entry to the list. [signal]

beginInsertColumns()
beginInsertRows()
beginMoveColumns()
beginMoveRows()
beginRemoveColumns()
beginRemoveRows()
beginResetModel()
beginUpdate

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

changePersistentIndex()
changePersistentIndexList()
childEvent()
columnCount(self, parent: QModelIndex) → int
connectNotify()
createIndex()
customEvent()
data(self, index: QModelIndex, role: int) → Any
decodeData()
disconnectNotify()
displayExpression(self) → str

The display expression will be used for

  • displaying values in the combobox
  • filtering based on filterValue
displayExpressionChanged

The display expression will be used for

  • displaying values in the combobox
  • filtering based on filterValue [signal]
encodeData()
endInsertColumns()
endInsertRows()
endMoveColumns()
endMoveRows()
endRemoveColumns()
endRemoveRows()
endResetModel()
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.

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.

extraIdentifierValueIndexChanged

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

extraValueDoesNotExist(self) → bool

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

extraValueDoesNotExistChanged

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

filterExpression(self) → str

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

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.

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]

identifierField(self) → str

The identifier field should be a unique field that can be used to identify individual features. It is normally set to the primary key of the layer.

identifierFieldChanged

The identifier field should be a unique field that can be used to identify individual features. It is normally set to the primary key of the layer. [signal]

index(self, row: int, column: int, parent: QModelIndex) → QModelIndex
isLoading(self) → bool

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

isLoadingChanged

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

isSignalConnected()
parent(self, child: QModelIndex) → QModelIndex
persistentIndexList()
receivers()
resetInternalData()
rowCount(self, parent: QModelIndex) → int
sender()
senderSignalIndex()
setAllowNull(self, allowNull: bool)

Add a NULL entry to the list.

setDisplayExpression(self, displayExpression: str)

The display expression will be used for

  • displaying values in the combobox
  • filtering based on filterValue
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.

setFilterExpression(self, filterExpression: str)

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

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.

setIdentifierField(self, identifierField: str)

The identifier field should be a unique field that can be used to identify individual features. It is normally set to the primary key of the layer.

setSourceLayer(self, sourceLayer: QgsVectorLayer)

The source layer from which features will be fetched.

sourceLayer(self) → QgsVectorLayer

The source layer from which features will be fetched.

sourceLayerChanged

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

timerEvent()