[Qgis-developer] Create groups in python plugins

Andres Manz manz.andres at gmail.com
Mon Nov 30 06:39:07 EST 2009


Hi List,

Well, I created a QgsLegendInterface with the functions
- addGroup( QString name );
- moveLayer( QgsMapLayer * layer, QString group )
- removeGroup( QString name );

There's (at least) one thing I don't like about this:
What if the user has more than one group with the same name?
All groups with the same name would be removed (removeGroup) or a
layer would be moved to the first group with the given name
(moveLayer). So the scripter / user does not have much control on the
group selection.

So if my current approach doesn't adequate, I'd prefer to create a
mini-interface for QgsLegendGroup and add it to the API, too, so the
python scripter would have a handle for the groups. (I would not know
how to name it, as a QgsLegendGroup already exists and QgsGroup would
be a bit too general, I guess. ;-))
Any objections?

I'm a little bit in a hurry, so I'm sorry it takes so long. Patch will
follow soon.

Regards
Andres


More information about the Qgis-developer mailing list