Class: QgsVectorLayerSelectedFeatureSource

class qgis.core.QgsVectorLayerSelectedFeatureSource

Bases: QgsFeatureSource, QgsExpressionContextScopeGenerator

QgsFeatureSource subclass for the selected features from a QgsVectorLayer.

New in version 3.0.

QgsVectorLayerSelectedFeatureSource(layer: 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

QgsExpressionContextScope

featureCount

rtype

int

fields

rtype

QgsFields

getFeatures

param request

hasSpatialIndex

rtype

QgsFeatureSource.SpatialIndexPresence

sourceCrs

rtype

QgsCoordinateReferenceSystem

sourceName

rtype

str

wkbType

rtype

QgsWkbTypes.Type

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