Class: QgsVirtualLayerTask¶
Initializes a virtual layer with postpone mode activated and reloads the data in a separated thread.
Added in version 3.2.
Class Hierarchy¶
Base classes¶
Abstract base class for long running background tasks.  | 
|
Methods
Cancels the pending query and the parent task.  | 
|
Returns the virtual layer definition.  | 
|
Returns the exception text or an empty string if no exceptions were raised  | 
|
Returns the underlying virtual layer.  | 
|
Reloads the data.  | 
|
Sets the exceptionText  | 
|
Returns the underlying virtual layer and ownership.  | 
- class qgis.core.QgsVirtualLayerTask[source]¶
 Bases:
QgsTask- __init__(definition: QgsVirtualLayerDefinition)
 Constructor.
- Parameters:
 definition (QgsVirtualLayerDefinition) – The definition to use for initializing the virtual layer
- definition(self) QgsVirtualLayerDefinition[source]¶
 Returns the virtual layer definition.
- Return type:
 
- exceptionText(self) str[source]¶
 Returns the exception text or an empty string if no exceptions were raised
Added in version 3.4.
- Return type:
 str
- layer(self) QgsVectorLayer | None[source]¶
 Returns the underlying virtual layer.
- Return type:
 Optional[QgsVectorLayer]
- run(self) bool[source]¶
 Reloads the data.
- Return type:
 bool
- Returns:
 Trueif the virtual layer is valid,Falseotherwise.
- setExceptionText(self, exceptionText: str | None)[source]¶
 Sets the
exceptionTextAdded in version 3.4.
- Parameters:
 exceptionText (Optional[str])
- takeLayer(self) QgsVectorLayer | None[source]¶
 Returns the underlying virtual layer and ownership.
- Return type:
 Optional[QgsVectorLayer]