Bug report #6879
addGroup() never allows adding to the "invisible root" group
|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|
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)
Fix addGroup() not to refuse invisibleRootItem as the group parent
NOTE: if a caller really wants to add a group to current item
there's a specific method for that: addGroupToCurrentItem
#11 Updated by Giovanni Manghi over 7 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.