Bug report #10752
Value Map not working when loading a qml
|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|
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
#3 Updated by Philipe Borba over 9 years ago
- File bug_qgis.JPG added
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"/>
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.
#4 Updated by Philipe Borba over 9 years ago
There is a similar explanation to this bug on this link: