22 : mDefinition( definition )
25 mLayer = qgis::make_unique<QgsVectorLayer>( mDefinition.
toString(),
"layer",
"virtual" );
34 rc = mLayer->isValid();
36 catch ( std::exception &e )
38 QgsDebugMsg( QStringLiteral(
"Reload error: %1" ).arg( e.what() ) );
56 return mLayer.release();
61 mLayer->dataProvider()->cancelReload();
bool run() override
Reloads the data.
QString toString() const
Convert into a QString that can be read by the virtual layer provider.
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.
Class to manipulate the definition of a virtual layer.