Bug report #6879
addGroup() never allows adding to the "invisible root" group
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | |||
Category: | Map Legend | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | fixed |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 16008 |
Description
The code for addGroup defaults to the so-called "invisible root item" as the parent,
but then refuses to add there because the "invisible root item" is not a group.
This makes it impossible to add a group to the root, basically (from python)
Associated revisions
Fix addGroup() not to refuse invisibleRootItem as the group parent
Fixes #6879.
NOTE: if a caller really wants to add a group to current item
there's a specific method for that: addGroupToCurrentItem
Fix adding groups to empty projects
Closes #6879 again
History
#1
Updated by Sandro Santilli over 12 years ago
- Status changed from Open to Closed
Fixed in changeset 122cff7859b74b213ba0bdc143850f635d122529.
#2
Updated by Alexander Bruy over 12 years ago
- Status changed from Closed to Reopened
After this commit it is impossible to create groups in empty project or add new group without selecting existing item in legend
#3
Updated by Giovanni Manghi over 12 years ago
- Priority changed from Normal to Severe/Regression
#4
Updated by Giovanni Manghi over 12 years ago
#5
Updated by Sandro Santilli over 12 years ago
Alex, when I tested this the db_manager plugin (sub-plugin topoviewer) was successfully adding groups to the "invisible root". Are you talking about GUI or python API or what ?
#6
Updated by Giovanni Manghi over 12 years ago
Sandro Santilli wrote:
Alex, when I tested this the db_manager plugin (sub-plugin topoviewer) was successfully adding groups to the "invisible root". Are you talking about GUI or python API or what ?
GUI (I can confirm the issue)
#7
Updated by Alexander Bruy over 12 years ago
Sandro, I tested this from GUI
#8
Updated by Sandro Santilli over 12 years ago
- Assignee set to Sandro Santilli
Confirmed. I'm on it.
#9
Updated by Sandro Santilli over 12 years ago
- Status changed from Reopened to Closed
Fixed in changeset 816c32bd064f1d8871f194f40bb701c899c5373d.
#10
Updated by Sandro Santilli over 12 years ago
there might be another regression, specifically the impossibility to determine where the new group is added (ie: now if you don't select a group item the new group is added to the root, not to the same group of the selected layer).
#11
Updated by Giovanni Manghi over 12 years ago
- Status changed from Closed to Reopened
Sandro Santilli wrote:
there might be another regression, specifically the impossibility to determine where the new group is added (ie: now if you don't select a group item the new group is added to the root, not to the same group of the selected layer).
if I understand well, yes is a regression, as before selecting a group and creating a new group allowed to have immediately a nested group.
#12
Updated by Sandro Santilli over 12 years ago
- Status changed from Reopened to Closed
- Resolution set to fixed
You didn't understand. What you describe is still possible.
Anyway I fixed what I meant with 7344368abefb149c05868c23cb0774b17653ea67
Please reopen if anything else is still missing
#13
Updated by Giovanni Manghi over 12 years ago
if I understand well