[Qgis-developer] Working with the new Legend

Martin Dobias wonder.sk at gmail.com
Wed Jul 9 02:52:35 PDT 2014


Hi Richard

> if I want to insert a new layer below some other one, I need to know the
> position of that one. I'm trying to find an index or so in Python, but
> cannot find it?
>
> Is there already a way to do this? (I want to put a buffer below the
> layer it has buffered)

You just need to find the index in parent's list of children:
node_idx = node.parent().children().index(node)

Regards
Martin


More information about the Qgis-developer mailing list