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.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
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()