Bug report #10752

Value Map not working when loading a qml

Added by Philipe Borba over 10 years ago. Updated about 10 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:2.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19136

Description

I'm trying to load a style saved as a .qml but when I load it, the value map defined in the .qml is not loaded. I have already tried to save the style into the database, but when I tried to load it, the value maps also weren't loaded.

A sample database is attached, with a sample of .qml

bug.rar (1.17 MB) Philipe Borba, 2014-06-29 01:12 PM

bug_qgis.JPG (210 KB) Philipe Borba, 2014-07-08 05:39 AM

Associated revisions

Revision e6a259d1
Added by Matthias Kuhn about 10 years ago

Save edit widgets also to QML style information.

Fix #11123
Fix #10752

History

#1 Updated by Jürgen Fischer over 10 years ago

  • Category set to Project Loading/Saving

#2 Updated by Matthias Kuhn over 10 years ago

  • Status changed from Open to Feedback

Does the following workaround to update the qml work for you?

  • Open layer/qml in 2.2
  • Save project
  • Open project in 2.4
  • Save qml in 2.4

#3 Updated by Philipe Borba over 10 years ago

Unfortunately it didn't work. In the qml structure saved by 2.4, the parts of the xml code where the value lists were stored weren't generated. The only parts of the qml that were generated are those linked to simbology. For instance, in the qml saved in 2.2, I have this structure:

<edittype labelontop="0" editable="1" type="3" name="geometriaaproximada">
<valuepair key="Sim" value="1"/>
<valuepair key="Não" value="2"/>
</edittype>

On the other hand, when I proceeded the way you instructed me, qgis 2.4 generates only this:

<edittype labelontop="0" editable="1" name="geometriaaproximada"/>

The type of the field is ommited and also the value pairs are gone.

If I manually set the value map, as it is show in the attached picture, then save the .qml, close qgis, reopen qgis and finally load the layer and the saved qml, the value map is not loaded and the problem with the code described above remains the same.

#5 Updated by Giovanni Manghi over 10 years ago

isn't this a regression since 2.2?

#6 Updated by Paolo Cavallini over 10 years ago

  • Priority changed from High to Severe/Regression

Duplicated in #10901?
It's a regression.

#7 Updated by Matthias Kuhn about 10 years ago

  • Status changed from Feedback to Closed

#8 Updated by James Rogers about 10 years ago

Sorry, I have zero understanding when it comes to coding, etc.
I am having this same problem with the value map info not saving/loading in the qml. Matthias, I see you fixed this in some python code? How do I update my QGIS to fix this issue?
Thanks

Also available in: Atom PDF