QGIS API Documentation  3.2.0-Bonn (bc43194)
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
6  email : [email protected]
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 "qgsvectorlayer.h"
23 #include "qgstaskmanager.h"
24 
33 class CORE_EXPORT QgsVirtualLayerTask : public QgsTask
34 {
35  Q_OBJECT
36 
37  public:
38 
44 
48  QgsVectorLayer *layer();
49 
53  QgsVectorLayer *takeLayer();
54 
58  QgsVirtualLayerDefinition definition() const;
59 
64  bool run() override;
65 
69  void cancel() override;
70 
71  private:
72  QgsVirtualLayerDefinition mDefinition;
73  std::unique_ptr<QgsVectorLayer> mLayer;
74 };
75 
76 #endif // QGSVECTORLAYERTASK_H
Initializes a virtual layer with postpone mode activated and reloads the data in a separated thread...
Abstract base class for long running background tasks.
virtual void cancel()
Notifies the task that it should terminate.
virtual bool run()=0
Performs the task&#39;s operation.
Represents a vector layer which manages a vector based data sets.
Class to manipulate the definition of a virtual layer.