qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.49k stars 2.99k forks source link

rule based labelling is not saved in qml style files #21701

Closed qgib closed 5 years ago

qgib commented 8 years ago

Author Name: Saber Razmjooei (@saberraz) Original Redmine Issue: 13667 Affected QGIS version: master Redmine category:labelling Assignee: Sebastian Dietrich


Rule-based labeling information of a layer doesn't get saved when exporting the style. To reproduce:

The label is always set to No labels for me. (2.12 cd9d645)


Related issue(s): #22420 (relates) Redmine related issue(s): 14441


qgib commented 8 years ago

Author Name: Saber Razmjooei (@saberraz)


qgib commented 8 years ago

Author Name: Saber Razmjooei (@saberraz)


qgib commented 8 years ago

Author Name: Saber Razmjooei (@saberraz)


Seems to be related to the introduction of combo box for the new labeling. If I do:

@iface.activeLayer().loadNamedStyle('/path/to/my_style.qml')@

And refresh my canvas the labels will be applied. But if I do it through load style...it doesn't work.

qgib commented 8 years ago

Author Name: Saber Razmjooei (@saberraz)


qgib commented 8 years ago

Author Name: Steven Bernard (Steven Bernard)


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?

qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 8 years ago

Author Name: Harry Clarke (@HarryEClarke)


Can this be fixed please as it is causing me problems, and workaround a lot of extra work


qgib commented 8 years ago

Author Name: Sebastian Dietrich (Sebastian Dietrich)


See "PR 2542":https://github.com/qgis/QGIS/pull/2542 for an early present from Santa Claus ;-)

workaround a lot of extra work

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:

=> 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.

qgib commented 8 years ago

Author Name: Sebastian Dietrich (Sebastian Dietrich)


qgib commented 8 years ago

Author Name: Nyall Dawson (@nyalldawson)


Fixed in changeset "04caab24a722ae13006f41baef7e12d191e32d3b".


qgib commented 8 years ago

Author Name: Reinhard Reiterer (Reinhard Reiterer)


Labeling information is still missing when loading a .qml file in QGIS 2.14.


qgib commented 8 years ago

Author Name: Sebastian Dietrich (Sebastian Dietrich)


I can not reproduce. Are you loading styles saved in an older version of QGIS? Please attach a QML file that does not load correctly in 2.14.


qgib commented 8 years ago

Author Name: Reinhard Reiterer (Reinhard Reiterer)


Please see bug report #22420 for further details.