Bug report #16996

regression: symbol levels broken (each category/rule repeated twice, settings not saved)

Added by Mathieu Pellerin - nIRV over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Symbology
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

Description

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
  1. Create a new project and add a vector layer
  2. Set the symbology to rule-based, and create two rules
  3. Open the symbols level dialog, notice how each rule is repeated twice
  4. Set non-zero values to a rule's layer(s), and press [ OK ]
  5. Re-open the symbol levels dialog, notice the non-zero values are gone

Screenshot from 2017-08-10 11-46-44.png (139 KB) Mathieu Pellerin - nIRV, 2017-08-10 06:56 AM

Associated revisions

Revision 5e7dadd5
Added by Mathieu Pellerin - nIRV over 6 years ago

[symbology] resurrect symbol levels dialog (fixes #16996)

History

#1 Updated by Mathieu Pellerin - nIRV over 6 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 ;)

#2 Updated by Mathieu Pellerin - nIRV over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF