QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsvirtuallayertask.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvirtuallayertask.h - description
3 -------------------
4 begin : Jan 19, 2018
5 copyright : (C) 2017 by Paul Blottiere
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSVIRTUALLAYERTASK_H
19#define QGSVIRTUALLAYERTASK_H
20
21#include "qgstaskmanager.h"
22#include "qgsvectorlayer.h"
24
33class CORE_EXPORT QgsVirtualLayerTask : public QgsTask
34{
35 Q_OBJECT
36
37 public:
43
48
53
58
63 bool run() override;
64
68 void cancel() override;
69
74 QString exceptionText() const;
75
80 void setExceptionText( const QString &exceptionText );
81
82 private:
83 QString mExceptionText;
84 QgsVirtualLayerDefinition mDefinition;
85 std::unique_ptr<QgsVectorLayer> mLayer;
86};
87
88#endif // QGSVECTORLAYERTASK_H
virtual bool run()=0
Performs the task's operation.
virtual void cancel()
Notifies the task that it should terminate.
QgsTask(const QString &description=QString(), QgsTask::Flags flags=AllFlags)
Constructor for QgsTask.
Represents a vector layer which manages a vector based dataset.
Manipulates the definition of a virtual layer.
QgsVectorLayer * takeLayer()
Returns the underlying virtual layer and ownership.
QString exceptionText() const
Returns the exception text or an empty string if no exceptions were raised.
QgsVectorLayer * layer()
Returns the underlying virtual layer.
QgsVirtualLayerDefinition definition() const
Returns the virtual layer definition.
QgsVirtualLayerTask(const QgsVirtualLayerDefinition &definition)
Constructor.
void setExceptionText(const QString &exceptionText)
Sets the exceptionText.