Bug report #16996
regression: symbol levels broken (each category/rule repeated twice, settings not saved)
|Affected QGIS version:||master||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||24895|
Under QGIS master, the whole symbol levels feature appears to be broken. When you open the symbol levels dialog, each category/rule is repeated twice, and the ordering for each layer forgotten upon leaving the dialog. See the attached screenshot showing the repeated category/rule issue.Steps to reproduce
- Create a new project and add a vector layer
- Set the symbology to rule-based, and create two rules
- Open the symbols level dialog, notice how each rule is repeated twice
- Set non-zero values to a rule's layer(s), and press [ OK ]
- Re-open the symbol levels dialog, notice the non-zero values are gone
#1 Updated by Mathieu Pellerin - nIRV about 4 years ago
OK, I figured out the problem here.
When the symbol levels dialog was implemented, it worked with pointers to symbol layers, which it used to set the rendering pass level (see 45caf4f6bc5acde5ac559b491ebfcea89ef58470).
At some point in time (which I can't exactly find due to the symbology-ng -> symbology directory renaming), the code was updated to pass on a QgsLegendSymbolList, iterating through QgsLegendSymbolItem to retrieve symbol pointers. That's problematic as QgsLegendSymbolItem's symbol pointer is cloned (see https://github.com/qgis/QGIS/blob/master/src/core/symbology/qgslegendsymbolitem.cpp#L30), therefore the symbol level dialog ends up setting the rendering pass level to a cloned symbol.
Martin, the ball is in your court ;)