Bug report #13667
rule based labelling is not saved in qml style files
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21701|
Rule-based labeling information of a layer doesn't get saved when exporting the style.
- Load a vector layer
- Set a lebel
- Save the style as qml
- Close the layer and re-open it
- Try to apply the saved qml
The label is always set to No labels for me. (2.12 cd9d645)
Refresh the label style widget when loading a new style (fixes #13667)
the QgsLabelingWidget is triggered to reload its settings when
- loading a style file
- loading a style from a database
- loading the default style
#5 Updated by Steven Bernard over 4 years ago
I have a similar issue where old qml style files, which have rule-based labelling in, no longer work when I try to apply them in 2.12. As mentioned this is likely because of the new dropdown menu. Isn't there a simple way to map the old .qml rule-based label style to the rule-based labelling dropdown menu option in 2.12?
#8 Updated by Sebastian Dietrich about 4 years ago
See PR 2542 for an early present from Santa Claus ;-)
Also note the following easy workaround, in case the PR takes a while to be merged or you are not able/willing to update to the nightly build:
workaround a lot of extra work
- Open the layer properties dialog
- Load the style
- Cancel the dialog
=> The style is applied to the layer, but is not yet visible.
To actually see it refresh the canvas, e.g. using the Refresh tool or by simply panning/zooming.