3

On QGIS, I would like to programmatically assign multiple .qml styles to a single layer with python.

I can add styles manually from the Properties dialog on the layer by selecting Styles->Add... but I cannot add them from a .qml

So the question is two-fold:

  1. How to add programmatically a second, third, etc style for the layer.
  2. If the new styles can be added from saved .qml's

So far my knowledge is limmited to loading one individual .qml with

layer.loadNamedStyle(path_to_qml_1)
1
  • 1
    What exactly do you mean with multiple styles in one layer, classifications? QML is a KML type file. Maybe you want to try to parse them together into a single *.qml and load that one? Commented Oct 14, 2016 at 9:52

0

Browse other questions tagged or ask your own question.