All Questions
4 questions
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(...
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 ...
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 ...
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... ...