[Qgis-developer] Create groups in python plugins

Martin Dobias wonder.sk at gmail.com
Tue Nov 10 07:33:15 EST 2009


On Thu, Nov 5, 2009 at 9:01 AM, Andres Manz <manz.andres at gmail.com> wrote:
> Hi,
>
> Would it be a good idea to implement that feature?
> I'm not sure if anyone could ever need it.
> I've read a bit of the code and saw that you would add new
> groups in QgsLegend.
>
> Well, adding new groups is not a problem there. But I'm not sure
> about how to move a map layer from one group to another.
> As far as I understand it, this would need QgsLegend to
> be in the qgis API, where I have some doubts. ;)

Enabling users to work with legend will be a good step forward. I
think we could create a QgsLegendInterface class available in gui
library that would allow manipulation with layers and groups in legend
widget:
- add / remove a group
- add / remove layer to/from a group
- list contents of legend or of one group
- modify layer / group visibility in canvas
- more...

But as always, there has to be someone to create such interface and do
the connection with legend classes - your patches are welcome!

Regards
Martin


More information about the Qgis-developer mailing list