Is there any way to load a *.qml file to layer and set a style to it in Python (PyQGIS)?
Can I 'get into' this file in console?
I want to review it.
asked Jul 15, 2016 at 7:19
1 Answer 1
I have my qml styles in a fix path (c:/pyqgis_data/Styles/). So, to load arrows_red_orange.qml (exclusively for point layers), next lines at the Python Console of QGIS work:
>>>layer = iface.activeLayer()
>>>if layer.geometryType() == QGis.Point:
>>>...layer.loadNamedStyle('c:/pyqgis_data/Styles/arrows_red_orange.qml')
>>>layer.triggerRepaint()
answered Jul 15, 2016 at 8:35
Explore related questions
See similar questions with these tags.
lang-py