Add a takeLayer method

This commit is contained in:
Blottiere Paul 2018-02-28 11:35:27 +01:00
parent 1ad02adfe0
commit 941aa0a650
3 changed files with 15 additions and 0 deletions

View File

@ -34,6 +34,11 @@ Constructor.
QgsVectorLayer *layer();
%Docstring
Returns the underlying virtual layer.
%End
QgsVectorLayer *takeLayer();
%Docstring
Returns the underlying virtual layer and ownership.
%End
QgsVirtualLayerDefinition definition() const;

View File

@ -52,6 +52,11 @@ QgsVectorLayer *QgsVirtualLayerTask::layer()
return mLayer.get();
}
QgsVectorLayer *QgsVirtualLayerTask::takeLayer()
{
return mLayer.release();
}
void QgsVirtualLayerTask::cancel()
{
mLayer->dataProvider()->cancel();

View File

@ -47,6 +47,11 @@ class CORE_EXPORT QgsVirtualLayerTask : public QgsTask
*/
QgsVectorLayer *layer();
/**
* Returns the underlying virtual layer and ownership.
*/
QgsVectorLayer *takeLayer();
/**
* Returns the virtual layer definition.
*/