<span style="color:rgb(34,34,34);line-height:22px">You have to refer to the group as root to remove his child</span><div style="color:rgb(34,34,34);line-height:22px"><br></div><div style="color:rgb(34,34,34);line-height:22px">Regards Luigi Pirelli</div><div style="color:rgb(34,34,34);line-height:22px"><br></div>On Wednesday, 17 December 2014, Germán Carrillo <<a href="mailto:carrillo.german@gmail.com">carrillo.german@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all (and Martin D.),<div><br></div><div><br></div><div>I've been trying to reproduce the instructions given here [1] for moving layers. It seems that the code doesn't work if the layer to be moved is inside a group.</div><div><br></div><div>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:</div><div><br></div><div>   root.removeChildNode( originalLayer )<br></div><div><div><br></div><div>It doesn't throw any message nor change the map/ToC status.</div><div><br></div></div><div><br></div><div>Can you reproduce the problem? I'm using QGIS 2.6.1 on Ubuntu.</div><div><br></div><div><br></div><div>Regards, </div><div><br></div><div>Germán Carrillo<br clear="all"><div>--</div><div>[1] <a href="http://www.lutraconsulting.co.uk/blog/2014/07/25/qgis-layer-tree-api-part-2/" target="_blank">http://www.lutraconsulting.co.uk/blog/2014/07/25/qgis-layer-tree-api-part-2/</a> </div><div><br></div>-- <br><div>-----------<br>   |\__  <br>(:>__)(<br>   |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br><a href="http://twitter.com/GeoTux2" target="_blank">http://twitter.com/GeoTux2</a><br></div>
</div></div>
</blockquote>