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)

closed as unclear what you're asking by Kadir Şahbaz, csk, whyzar, HDunn, Andre Silva Apr 6 at 1:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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? – Hydrographer Oct 14 '16 at 9:52

Browse other questions tagged or ask your own question.