[Qgis-developer] Moving a layer with PyQGIS using the new layer tree
luipir at gmail.com
Wed Dec 17 14:39:45 PST 2014
You have to refer to the group as root to remove his child
Regards Luigi Pirelli
On Wednesday, 17 December 2014, Germán Carrillo <carrillo.german at gmail.com>
> Hi all (and Martin D.),
> I've been trying to reproduce the instructions given here  for moving
> layers. It seems that the code doesn't work if the layer to be moved is
> inside a group.
> Specifically, trying to move a layer that is inside a group, I can add the
> clonned layer to the layer tree but I cannot get the original layer
> removed, i.e., the following command doesn't work:
> root.removeChildNode( originalLayer )
> It doesn't throw any message nor change the map/ToC status.
> Can you reproduce the problem? I'm using QGIS 2.6.1 on Ubuntu.
> Germán Carrillo
> Soluciones Geoinformáticas Libres
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer