Skip to content

Instantly share code, notes, and snippets.

@thbaumann
Created March 4, 2021 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thbaumann/31839f5099bf6dc977ab7a714e0b19d7 to your computer and use it in GitHub Desktop.
Save thbaumann/31839f5099bf6dc977ab7a714e0b19d7 to your computer and use it in GitHub Desktop.
# for testing in QGIS console
style_name = 'Druckstufen'
layer=iface.activeLayer()
stylemanager = layer.styleManager()
current_style = stylemanager.currentStyle()
#print(curr_style)
# stil nur wechseln wenn nicht schon aktuell eingestellt
if style_name != current_style:
stylemanager.setCurrentStyle(style_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment