Class: QgsVectorLayerSelectedFeatureSource

class qgis.core.QgsVectorLayerSelectedFeatureSource(layer: QgsVectorLayer)

Bases: QgsFeatureSource, QgsExpressionContextScopeGenerator

Constructor for QgsVectorLayerSelectedFeatureSource, for selected features from the specified layer. The currently selected feature IDs are stored, so change to the layer selection after constructing the QgsVectorLayerSelectedFeatureSource will not be reflected.

QgsVectorLayerSelectedFeatureSource(QgsVectorLayerSelectedFeatureSource)

QgsFeatureSource subclass for the selected features from a QgsVectorLayer.

New in version 3.0.

Parameters

layer

createExpressionContextScope(self)QgsExpressionContextScope
Return type

QgsExpressionContextScope

featureCount(self) → int
Return type

int

fields(self)QgsFields
Return type

QgsFields

getFeatures(self, request: QgsFeatureRequest = QgsFeatureRequest())QgsFeatureIterator
Parameters

request (QgsFeatureRequest = QgsFeatureRequest()) –

Return type

QgsFeatureIterator

hasSpatialIndex(self) → QgsFeatureSource.SpatialIndexPresence
Return type

QgsFeatureSource.SpatialIndexPresence

sourceCrs(self)QgsCoordinateReferenceSystem
Return type

QgsCoordinateReferenceSystem

sourceName(self) → str
Return type

str

wkbType(self) → QgsWkbTypes.Type
Return type

QgsWkbTypes.Type