Class: QgsVirtualLayerTask

class qgis.core.QgsVirtualLayerTask(definition: QgsVirtualLayerDefinition)

Bases: qgis._core.QgsTask

Constructor.

Parameters

definition – The definition to use for initializing the virtual layer

Initializes a virtual layer with postpone mode activated and reloads the data in a separated thread.

New in version 3.2: Enums

Methods

cancel

Cancels the pending query and the parent task.

childEvent

connectNotify

customEvent

definition

Returns the virtual layer definition.

disconnectNotify

exceptionText

Returns the exception text or an empty string if no exceptions were raised

finished

isCanceled

isSignalConnected

layer

Returns the underlying virtual layer.

receivers

run

Reloads the data.

sender

senderSignalIndex

setExceptionText

Sets the exceptionText

setProgress

takeLayer

Returns the underlying virtual layer and ownership.

timerEvent

Signals

Attributes

cancel(self)

Cancels the pending query and the parent task.

childEvent()
connectNotify()
customEvent()
definition(self) → QgsVirtualLayerDefinition

Returns the virtual layer definition.

disconnectNotify()
exceptionText(self) → str

Returns the exception text or an empty string if no exceptions were raised

New in version 3.4.

finished()
isCanceled()
isSignalConnected()
layer(self) → QgsVectorLayer

Returns the underlying virtual layer.

receivers()
run(self) → bool

Reloads the data.

Returns

True if the virtual layer is valid, false otherwise.

sender()
senderSignalIndex()
setExceptionText(self, exceptionText: str)

Sets the exceptionText

New in version 3.4.

setProgress()
takeLayer(self) → QgsVectorLayer

Returns the underlying virtual layer and ownership.

timerEvent()