You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author Name: Peter Petrik (@PeterPetrik)
Original Redmine Issue: 14153
Affected QGIS version: master
Redmine category:edit_widget
This code correctly loads style from qml file and adds layer 'test' to the map canvas (see attached zip file).
The QML file defines edit widget for attribute called 'attr' with the 'value map' type (see attached screenshot):
Author Name: Sebastian Dietrich (Sebastian Dietrich)
Widgets are loaded separately from the layers by "@QgsEditorWidgetRegistry@":http://qgis.org/api/classQgsEditorWidgetRegistry.html. It watches the layers that are known to it and when a layer is loading a new style, @QgsEditorWidgetRegistry@ loads the widgets for that layer.
Unfortunately @QgsEditorWidgetRegistry@ only knows of the layers that are added to "@QgsMapLayerRegistry@":http://qgis.org/api/classQgsMapLayerRegistry.html. So the effect is as you describe: loading QML after adding the layer works, loading QML before adding the layer does not.
The solution could be to simply make all (vector-)layers known to @QgsEditorWidgetRegistry@. But that might have other, probably unwanted, effects. I can't tell.
Author Name: Peter Petrik (@PeterPetrik)
Original Redmine Issue: 14153
Affected QGIS version: master
Redmine category:edit_widget
This code correctly loads style from qml file and adds layer 'test' to the map canvas (see attached zip file).
The QML file defines edit widget for attribute called 'attr' with the 'value map' type (see attached screenshot):
But this code doesn't load correct edit widget, just shows default 'Text Edit' edit widget
Note: both codes correctly load renderer style
The text was updated successfully, but these errors were encountered: