23 : mDefinition( definition )
26 mLayer = qgis::make_unique<QgsVectorLayer>( mDefinition.
toString(),
"layer",
"virtual" );
35 rc = mLayer->isValid();
37 catch ( std::exception &e )
39 QgsDebugMsg( QStringLiteral(
"Reload error: %1" ).arg( e.what() ) );
58 return mLayer.release();
63 mLayer->dataProvider()->cancelReload();
69 return mExceptionText;
bool run() override
Reloads the data.
QString toString() const
Convert into a QString that can be read by the virtual layer provider.
QString exceptionText() const
Returns the exception text or an empty string if no exceptions were raised.
QgsVectorLayer * takeLayer()
Returns the underlying virtual layer and ownership.
QgsVectorLayer * layer()
Returns the underlying virtual layer.
virtual void cancel()
Notifies the task that it should terminate.
void cancel() override
Cancels the pending query and the parent task.
QgsVirtualLayerDefinition definition() const
Returns the virtual layer definition.
void setLazy(bool lazy)
Sets the lazy mode.
Represents a vector layer which manages a vector based data sets.
QgsVirtualLayerTask(const QgsVirtualLayerDefinition &definition)
Constructor.
void setExceptionText(const QString &exceptionText)
Sets the exceptionText.
Class to manipulate the definition of a virtual layer.