[Qgis-developer] Legend group API

Duarte Carreira DCarreira at edia.pt
Wed Dec 12 03:14:12 PST 2012


Hello all.

I agree with Massimo. We, users and python plugin developers, need a very small set of functions to work with the layer tree.

For example, we cannot find a way to add a subgroup to the top or middle of an existing group. They are always put at the bottom of the group:

-group 1
  - layer 1.1
  - layer 1.2
  - group 1.1

This way qgis is really very limited in automating complex cartography.

You should be able to do:

- group 1
  - layer 1.1
  - group 1.1
  - layer 1.2

Just quickly fixing the simple, obvious limitations on the api today would be the first step, that would allow a new revision fast. Later, you can revamp the whole thing with all the bells and whistles you want...

Regards,
Duarte

-----Mensagem original-----
De: Massimo Endrighi [mailto:massimo.endrighi at geopartner.it] 
Enviada: terça-feira, 11 de Dezembro de 2012 15:42
Para: qgis-developer at lists.osgeo.org
Assunto: Re: [Qgis-developer] Legend group API

Sandro Santilli-2 wrote
> I think Martin ideas is sensible and I do see the code is going in 
> that direction. But even if the classes are decoupled from the QT tree 
> widget we'll need a way to identify groups, as much as we do with 
> layers (which do have an ID). I've no problem with all elements (be 
> them layers or groups or whatever) share the same "id space" but each 
> one should have an identifier which remains valid for the whole 
> lifetime of that object.

Please keep in mind that it is also necessary to be able to:
- move/put a layer into a sub group (not only a top level item as it was in
1.8)
- remove a sub group (not only a top level item as it was in 1.8)
- move a layer before or after another layer inside the same group
- walk thought the legend hierarchy even when there are sub groups and multiple group with the same name (the groupLayerRelationship is unusable in some circumstances)

See also previous  threads:
-  index-in-self-legend-groupLayerRelationship-different-behavior
<http://osgeo-org.1560.n6.nabble.com/index-in-self-legend-groupLayerRelationship-different-behavior-between-QGIS-1-8-and-master-td5004337.html#a5006614>
-  QgsLegendInterface-implementation-works-only-on-top-level-items
<http://osgeo-org.1560.n6.nabble.com/QgsLegendInterface-implementation-works-only-on-top-level-items-td4999348.html>  

Massimo.





--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Legend-group-API-tp5022115p5022262.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.




More information about the Qgis-developer mailing list