Layer grouping bug in legend #15839
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Map and Legend
Related to map or legend rendering
Milestone
Author Name: Larry Shaffer (Larry Shaffer)
Original Redmine Issue: 6665
Affected QGIS version: master
Redmine category:map_legend
Not sure where this may affect functionality beyond the QgsApp::duplicateLayers() method, but...
When using duplicateLayers() on a selection inside a group, where that group has more than 4 items and the selection is after the fourth item, the duplicated layer(s) is added to the QgsMapLayerRegistry, but not added to the legend. If any layer past 4 items is moved to one of the first 4 item placements (i.e. directly under the grouping) then the layer works properly when duplicated. I have no idea why the number of layers in a grouping would have any affect on adding layers to QgsMapLayerRegistry.
It seems to have no bearing on what type of layer is being duplicated, or which group it is associated with. Currently, duplicateLayers() works around this by manually adding the QgsLegendLayer(s) after determining that those layers did not get added to the legend.
The text was updated successfully, but these errors were encountered: