Class: QgsVirtualLayerTask

class qgis.core.QgsVirtualLayerTask(definition: QgsVirtualLayerDefinition)

Bases: QgsTask

Constructor.

Parameters

definition (QgsVirtualLayerDefinition) – 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.

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

cancel(self)

Cancels the pending query and the parent task.

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

Returns the virtual layer definition.

Return type

QgsVirtualLayerDefinition

disconnectNotify()
exceptionText(self) → str

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

New in version 3.4.

Return type

str

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

Returns the underlying virtual layer.

Return type

QgsVectorLayer

receivers()
run(self) → bool

Reloads the data.

Return type

bool

Returns

True if the virtual layer is valid, false otherwise.

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

Sets the exceptionText

New in version 3.4.

Parameters

exceptionText (str) –

setProgress()
takeLayer(self) → QgsVectorLayer

Returns the underlying virtual layer and ownership.

Return type

QgsVectorLayer

timerEvent()