Class: QgsVirtualLayerTask¶
Initializes a virtual layer with postpone mode activated and reloads the data in a separate thread.
Added in version 3.2.
Class Hierarchy¶
Base classes¶
Abstract base class for long running background tasks. |
|
Abstract Methods
Reloads the data. |
Methods
Returns the virtual layer definition. |
|
Returns the exception text or an empty string if no exceptions were raised |
|
Returns the underlying virtual layer. |
|
Sets the exceptionText |
|
Returns the underlying virtual layer and ownership. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsVirtualLayerTask. See the FAQ for more details.
Cancels the pending query and the parent task. |
- 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]
- abstract run(self) bool [source]¶
Reloads the data.
- Return type:
bool
- Returns:
True
if the virtual layer is valid,False
otherwise.
- setExceptionText(self, exceptionText: str | None)[source]¶
Sets the
exceptionText
Added in version 3.4.
- Parameters:
exceptionText (Optional[str])
- takeLayer(self) QgsVectorLayer | None [source]¶
Returns the underlying virtual layer and ownership.
- Return type:
Optional[QgsVectorLayer]