QgsVirtualLayerTask class

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

Base classes

class QgsTask
Abstract base class for long running background tasks.

Constructors, destructors, conversion operators

QgsVirtualLayerTask(const QgsVirtualLayerDefinition& definition)
Constructor.

Public functions

void cancel() override
Cancels the pending query and the parent task.
auto definition() const -> QgsVirtualLayerDefinition
Returns the virtual layer definition.
auto exceptionText() const -> QString
Returns the exception text or an empty string if no exceptions were raised.
auto layer() -> QgsVectorLayer*
Returns the underlying virtual layer.
auto run() -> bool override
Reloads the data.
void setExceptionText(const QString& exceptionText)
Sets the exceptionText.
auto takeLayer() -> QgsVectorLayer*
Returns the underlying virtual layer and ownership.

Function documentation

QgsVirtualLayerTask::QgsVirtualLayerTask(const QgsVirtualLayerDefinition& definition)

Constructor.

Parameters
definition The definition to use for initializing the virtual layer

QString QgsVirtualLayerTask::exceptionText() const

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

bool QgsVirtualLayerTask::run() override

Reloads the data.

Returns True if the virtual layer is valid, false otherwise.

void QgsVirtualLayerTask::setExceptionText(const QString& exceptionText)

Sets the exceptionText.