Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
1 answer
543 views

Loading QLR file in QGIS using PyQGIS

I'm trying to load a qlr-file in QGIS 3.16 and zoom to a certain area using python: QgsLayerDefinition.loadLayerDefinition('E:/QGIS/test.qlr',QgsProject.instance(), QgsProject.instance().layerTreeRoot(...
Tobi's user avatar
  • 41
1 vote
0 answers
372 views

QLR loaded via PyQGIS not loading correctly but works when using layer--add qlr

Based on Load .qlr with loadNamedStyle I was able to add a QLR to a python tool via PyQGIS -however, it appears broken... elif ftype=='qlr': try: print ...
GeorgeC's user avatar
  • 8,298
3 votes
1 answer
1k views

Load .qlr with loadNamedStyle

I tried >>>QgsVectorLayer.loadNamedStyle(r'C:\Some\Path\FOO.qlr') Get this error: Traceback (most recent call last): File "<input>", line 1, in <module> TypeError: arguments ...
VilyaSeeFour's user avatar
3 votes
0 answers
384 views

Adding multiple styles to single layer with pyQGIS? [closed]

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... ...
Ricardo's user avatar
  • 31