Feature request #3263
QgsLegendInterface.addGroup() nests all groups
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | Marco Hugentobler | ||
Category: | Map Legend | ||
Pull Request or Patch supplied: | Resolution: | fixed | |
Easy fix?: | No | Copied to github as #: | 13323 |
Description
The following code adds four groups to the legend. Unfortunately they're all nested while the goal would be to put them into legend root:
i = qgis.utils.iface l = i.legendInterface() groupAnnotation = l.addGroup("Annotation",False) groupDimensioning = l.addGroup("Dimensioning", True) groupLocation = l.addGroup("Location", True) groupTopo = l.addGroup("Topo", True)
History
#1 Updated by Marco Bernasocchi almost 14 years ago
I m dealing with the same problem in my multiview plugin (https://issues.qgis.org/projects/multiview/repository/revisions/master/entry/temporalrasterloaderdialog.py) and i noticed that if i create a group and then load a layer the groups get created at the end of the list (look for the hack in the link). So maybe it is a more complex issue/bug.
#2 Updated by Marco Hugentobler almost 14 years ago
Applied in 855601c3 (SVN r15562). Thanks!
#3 Updated by Borys Jurgiel almost 14 years ago
- Resolution set to fixed
- Status changed from Open to Closed
I believe it can be closed now.
#4 Updated by Marco Bernasocchi almost 14 years ago
- Status changed from Closed to Feedback
- Resolution deleted (
fixed)
#5 Updated by Borys Jurgiel almost 14 years ago
applied in bf9e9d54 (SVN r15595)
#6 Updated by Borys Jurgiel almost 14 years ago
- Resolution set to fixed
- Status changed from Feedback to Closed
#7 Updated by Marco Bernasocchi over 13 years ago
- Status changed from Closed to Feedback
- Resolution deleted (
fixed)
the patch applied was an incomplete one... missunderstanding between Marcos :) here the patch to the patch
ciao
#8 Updated by Marco Hugentobler over 13 years ago
- Resolution set to fixed
- Status changed from Feedback to Closed
Applied in with two small modifications:
-added missing return statement in addGroupToCurrentItem()
-removed debug msg
#9 Updated by Marco Bernasocchi over 13 years ago
ups... :|
#10 Updated by Marco Bernasocchi over 13 years ago
- Status changed from Closed to Feedback
- Resolution deleted (
fixed)
added python bindings. it supports only nesting into a top level element like removeGroup. we should think of a more flexible solution.
#11 Updated by Marco Hugentobler over 13 years ago
Yes, all these group functions with int indices come frome the pre-multiple nesting time. It would probably be better to do a bit of interface redesign for both QgsLegend and QgsLegendInterface after 1.7 (maybe working with QTreeWidgetItems)
#12 Updated by Marco Bernasocchi over 13 years ago
Replying to [comment:13 mhugent]:
Yes, all these group functions with int indices come frome the pre-multiple nesting time. It would probably be better to do a bit of interface redesign for both QgsLegend and QgsLegendInterface after 1.7 (maybe working with QTreeWidgetItems)
True, once done with my master we can have a look at it. will you still apply the patch?
#13 Updated by Marco Hugentobler over 13 years ago
- Status changed from Feedback to Closed
- Resolution set to fixed
Yes, applied in b8853323 (SVN r15788)