Re: [QGIS-Developer] loadNamedStyle() is loading default style instead of QML file

2023-09-11 Thread Jacky Volpes via QGIS-Developer
Hi Alexandre, When the layer is a PostgreSQL layer, it's the method from QgsVectorLayer which is called: https://qgis.org/pyqgis/3.32/core/QgsVectorLayer.html#qgis.core.QgsVectorLayer.loadNamedStyle https://api.qgis.org/api/classQgsVectorLayer.html#a2bd3a21badac411179dbfbc724136a45 The docu

[QGIS-Developer] loadNamedStyle() is loading default style instead of QML file

2023-09-11 Thread Alexandre Neto via QGIS-Developer
I am trying to load a style from a QML file into a vector layer. When I use a memory layer, loading the style works fine with the following code: layer = iface.activeLayer() layer.loadNamedStyle(path_to_style) If the layer is a postgreSQL layer with a default style, the above code will return: