Subgroup: Vector

Class: QgsVectorLayerFeatureCounter

class qgis.core.QgsVectorLayerFeatureCounter

Bases: qgis._core.QgsTask

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

addSubTask Adds a subtask to this task.
blockSignals
canCancel Returns true if the task can be canceled.
cancel Notifies the task that it should terminate.
childEvent
children
connectNotify
customEvent
deleteLater
dependentLayers Returns the list of layers on which the task depends.
description Returns the task’s description.
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
featureCount Get the feature count for a particular legendKey.
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
finished
flags Returns the flags associated with the task.
fromFunction Creates a new QgsTask task from a python function.
hold Places the task on hold.
inherits
installEventFilter
isActive Returns true if the task is active, ie it is not complete and has not been canceled.
isCanceled
isSignalConnected
isWidgetType
isWindowType
killTimer
metaObject
moveToThread
objectName
parent
progress Returns the task’s progress (between 0.0 and 100.0)
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeEventFilter
run
sender
senderSignalIndex
setDependentLayers Sets a list of layers on which the task depends.
setObjectName
setParent
setProgress
setProperty
signalsBlocked
startTimer
status Returns the current task status.
thread
timerEvent
tr
unhold Releases the task from being held.
waitForFinished Blocks the current thread until the task finishes or a maximum of timeout milliseconds.

Attributes

AllFlags
CanCancel
Complete
OnHold
ParentDependsOnSubTask
Queued
Running
SubTaskIndependent
Terminated
begun Will be emitted by task to indicate its commencement.
destroyed destroyed(self, QObject = None) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
progressChanged Will be emitted by task when its progress changes.
staticMetaObject
statusChanged Will be emitted by task when its status changes.
symbolsCounted Emitted when the symbols have been counted.
taskCompleted Will be emitted by task to indicate its successful completion.
taskTerminated Will be emitted by task if it has terminated for any reason other then completion (e.g., when a task has been canceled or encountered an internal error).
childEvent()
connectNotify()
customEvent()
disconnectNotify()
featureCount(self, legendKey: str) → int

Get 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()