Class: QgsVectorLayerFeatureCounter

class qgis.core.QgsVectorLayerFeatureCounter(layer: QgsVectorLayer, context: QgsExpressionContext = QgsExpressionContext())

Bases: qgis._core.QgsTask

Create a new feature counter for layer.

Counts the features in a QgsVectorLayer in task. You should most likely not use this directly and instead call QgsVectorLayer.countSymbolFeatures() and connect to the signal QgsVectorLayer.symbolFeatureCountMapChanged()

New in version 3.0: Methods

childEvent
connectNotify
customEvent
disconnectNotify
featureCount Gets the feature count for a particular legendKey.
finished
isCanceled
isSignalConnected
receivers
run
sender
senderSignalIndex
setProgress
timerEvent

Signals

symbolsCounted Emitted when the symbols have been counted.

Attributes

childEvent()
connectNotify()
customEvent()
disconnectNotify()
featureCount(self, legendKey: str) → int

Gets the feature count for a particular legendKey. If the key has not been found, -1 will be returned.

finished()
isCanceled()
isSignalConnected()
receivers()
run(self) → bool
sender()
senderSignalIndex()
setProgress()
symbolsCounted

Emitted when the symbols have been counted. [signal]

timerEvent()