I have added a layer to the layer tree and now I want to remove it from the 
layer tree:

self.layer = self.create_my_layer()

QgsProject.instance().layerTreeRoot().insertLayer(0, self.layer)

QgsProject.instance().layerTreeRoot().removeLayer(self.layer)

But it seems like my layer has been destroyed while removing it from the layer 
tree. Is it possible to not destroy the layer while still removing it from the 
tree?


Regards, Casper
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to