[Qgis-developer] Legend group API

Duarte Carreira DCarreira at edia.pt
Wed Dec 12 05:07:42 PST 2012


I wish I knew enough to provide a patch, I really do.

I think this is not new functionality in qgis: we can do it by hand, save, load. No problem. We just cannot automate it using python in its current state.

We are working on a python plugin and as it gets ready we will publish it. Today, the limitation is we cannot add nested groups *unless* they are at the bottom of the parent group. Because python api cannot insert/move them to any other position than bottom of the parent.

The python api is just missing this small piece of functionality to have 100% of the basis of layer tree manipulation:
Support moving a group up and down inside a given parent... we could not find a way to do that.

Everything else is already there, with some quirks, but we've been able to work our way around those in 1.9...

So, my plea was just to ask those who know to make a few little fixes before going for a full blown remake of the legend api, since that subject was being discussed.

Thanks,
Duarte

-----Mensagem original-----
De: Sandro Santilli [mailto:sandro.santilli at gmail.com] Em nome de Sandro Santilli
Enviada: quarta-feira, 12 de Dezembro de 2012 12:30
Para: Duarte Carreira
Cc: Massimo Endrighi; qgis-developer at lists.osgeo.org
Assunto: Re: [Qgis-developer] Legend group API

On Wed, Dec 12, 2012 at 12:20:33PM +0000, Duarte Carreira wrote:
> Sandro, I had seen your pull request but could not figure out if that is all it takes... does it solve the lack of ability to add groups and move them around, even in nested groups?

No. My pull request is aimed at fixing a bug, not at introducing a new feature.

> We could get by with a simple movelayer (or addlayer or addgroup) that works with groups too, not just layers, and inside whatever tree level. The embed layers menu option works fine using the C api, that just isn't exposed to python. I've attached images of an example.

Sure, I see no problem with adding a moveGroup to put a group under another.
But I guess such new feature should also be supported by project load/save, whereas project must be able to store the full hierarchy (is that already the case ?)

Are you willing to provide a patch to do that ?
Do we have a testing framework for project save/load roundtrip ?

--strk;




More information about the Qgis-developer mailing list