Class: QgsVectorLayerSelectedFeatureSource

class qgis.core.QgsVectorLayerSelectedFeatureSource

Bases: QgsFeatureSource, QgsExpressionContextScopeGenerator

QgsFeatureSource subclass for the selected features from a QgsVectorLayer.

Added in version 3.0.

QgsVectorLayerSelectedFeatureSource(layer: Optional[QgsVectorLayer]) 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.

Methods

createExpressionContextScope

rtype:

Optional[QgsExpressionContextScope]

featureCount

rtype:

int

fields

rtype:

QgsFields

getFeatures

param request:

hasSpatialIndex

rtype:

QgsFeatureSource.SpatialIndexPresence

sourceCrs

rtype:

QgsCoordinateReferenceSystem

sourceName

rtype:

str

wkbType

rtype:

Qgis.WkbType

createExpressionContextScope(self) QgsExpressionContextScope | None
Return type:

Optional[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) Qgis.WkbType
Return type:

Qgis.WkbType