Skip to content

'Legend format' within vector graduated style panel resets every time 'Classify' is pressed. #63276

@angusmcb

Description

@angusmcb

What is the bug or the crash?

Within the graduated renderer panel, the 'legend format' is reset every time the classes are re-classified.

I believe this should not be the case. The 'legend format' should persist even after reclassification.

Steps to reproduce the issue

  1. Create a new vector layer with a 'double' field, add a couple of features. For example:
l = QgsVectorLayer("LineString?field=test:double", "test layer", "memory")

f1=QgsFeature()
f1.setAttributes([1.0])

f2=QgsFeature()
f2.setAttributes([2.0])

with edit(l):
    l.addFeature(f1)
    l.addFeature(f2)
    
QgsProject().instance().addMapLayer(l)
  1. Open the layer styling panel.

  2. Set the layer styling to 'Graduated'

  3. Set value to field of interest (with above examle it will be 'test')

  4. Press 'Classify' -> all normal

  5. Modify the 'Legend format' -> the labels update. All normal.

  6. Press 'Classify' again -> the 'Legend format' is reset.

I believe that the 'Legend format' is not meant to be reset like this

Versions

QGIS version3.44.3-Solothurn
QGIS code revision1d1d67e9edd
 
Libraries
Qt version5.15.13
Python version3.12.11
GDAL version3.11.3 — Eganville
PROJ version9.6.2
EPSG Registry database versionv12.013 (2025-05-26)
GEOS version3.13.1-CAPI-1.19.2
SQLite version3.50.4
PDAL version2.9.0
PostgreSQL client version17.3
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionWindows 11 Version 2009
 
Active Python plugins
wntrqgis0.3.0
db_manager0.1.20
grassprovider2.12.99
MetaSearch0.3.6
processing2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugEither a bug report, or a bug fix. Let's hope for the latter!GUI/UXRelated to QGIS application GUI or User ExperienceStyles

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions