Skip to content

Commit 941aa0a

Browse files
committed
Add a takeLayer method
1 parent 1ad02ad commit 941aa0a

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

python/core/qgsvirtuallayertask.sip.in

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ Constructor.
3434
QgsVectorLayer *layer();
3535
%Docstring
3636
Returns the underlying virtual layer.
37+
%End
38+
39+
QgsVectorLayer *takeLayer();
40+
%Docstring
41+
Returns the underlying virtual layer and ownership.
3742
%End
3843

3944
QgsVirtualLayerDefinition definition() const;

src/core/qgsvirtuallayertask.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ QgsVectorLayer *QgsVirtualLayerTask::layer()
5252
return mLayer.get();
5353
}
5454

55+
QgsVectorLayer *QgsVirtualLayerTask::takeLayer()
56+
{
57+
return mLayer.release();
58+
}
59+
5560
void QgsVirtualLayerTask::cancel()
5661
{
5762
mLayer->dataProvider()->cancel();

src/core/qgsvirtuallayertask.h

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ class CORE_EXPORT QgsVirtualLayerTask : public QgsTask
4747
*/
4848
QgsVectorLayer *layer();
4949

50+
/**
51+
* Returns the underlying virtual layer and ownership.
52+
*/
53+
QgsVectorLayer *takeLayer();
54+
5055
/**
5156
* Returns the virtual layer definition.
5257
*/

0 commit comments

Comments
 (0)