QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
23 : mDefinition( definition )
27 mLayer = std::make_unique<QgsVectorLayer>( mDefinition.
toString(), QStringLiteral(
"layer" ), QLatin1String(
"virtual" ), options );
36 rc = mLayer->isValid();
38 catch ( std::exception &e )
40 QgsDebugMsg( QStringLiteral(
"Reload error: %1" ).arg( e.what() ) );
59 return mLayer.release();
64 mLayer->dataProvider()->cancelReload();
70 return mExceptionText;
Contains information about the context in which a coordinate transform is executed.
QgsVectorLayer * layer()
Returns the underlying virtual layer.
QString exceptionText() const
Returns the exception text or an empty string if no exceptions were raised.
void setLazy(bool lazy)
Sets the lazy mode.
bool run() override
Reloads the data.
virtual void cancel()
Notifies the task that it should terminate.
QgsVirtualLayerDefinition definition() const
Returns the virtual layer definition.
void cancel() override
Cancels the pending query and the parent task.
void setExceptionText(const QString &exceptionText)
Sets the exceptionText.
Setting options for loading vector layers.
Represents a vector layer which manages a vector based data sets.
Class to manipulate the definition of a virtual layer.
QgsVectorLayer * takeLayer()
Returns the underlying virtual layer and ownership.
QgsVirtualLayerTask(const QgsVirtualLayerDefinition &definition)
Constructor.
QString toString() const
Convert into a QString that can be read by the virtual layer provider.