Re: [Qgis-developer] How to load a QLR file with pyQGIS ?

2016-05-12 Thread Alain
Hello 2016-05-12 8:58 GMT+02:00 Alain [via OSGeo.org] < ml-node+s1560n5265951...@n6.nabble.com>: > Hello, > > > There is any way, in the new QGIS versions, to load the .qrl ,Definition > Layer Files, with python ? > > Thanks, > Alain > > -- > If you reply to this

Re: [Qgis-developer] How to load a QLR file with pyQGIS ?

2015-04-16 Thread Nathan Woodrow
Hey, QLR files are not style files they can't be loaded like that. Unfortunately the API for loading a QLR is broken in 2.8.1 but will be fixed in 2.8.2, however the logic isn't very complex and you can translate it to Python from C++. The source is here

Re: [Qgis-developer] How to load a QLR file with pyQGIS ?

2015-04-16 Thread Geo DrinX
Very strange :( I inserted also thetriggerRepaint() but nothing changes. This is my sourcecode: https://github.com/geodrinx/smartroadsense/blob/master/smartroadsense.py If I drag and drop in QGIS my srs_data.qlr file, it works. Instead, from python code, the style is not

Re: [Qgis-developer] How to load a QLR file with pyQGIS ?

2015-04-16 Thread Nathan Woodrow
Ok but your said QLR in your message hence my answer. Natham On Thu, 16 Apr 2015 5:35 pm Geo DrinX geodr...@gmail.com wrote: QLR files are not style files I am trying with a .qml file, but the result is the same : no style applied using a CSV and python. Instead, if I use SHP and

Re: [Qgis-developer] How to load a QLR file with pyQGIS ?

2015-04-16 Thread Geo DrinX
QLR files are not style files I am trying with a .qml file, but the result is the same : no style applied using a CSV and python. Instead, if I use SHP and QML, the style is applied immediately after loading the SHP. But, for do this, I should need convert my CSV into SHP every time,

Re: [Qgis-developer] How to load a QLR file with pyQGIS ?

2015-04-16 Thread Gary Sherman
On 4/15/15 10:55 PM, Nathan Woodrow wrote: Hey, QLR files are not style files they can't be loaded like that. OH :) My brain read QML... Unfortunately the API for loading a QLR is broken in 2.8.1 but will be fixed in 2.8.2, however the logic isn't very complex and you can translate it to

Re: [Qgis-developer] How to load a QLR file with pyQGIS ?

2015-04-15 Thread Gary Sherman
On 4/15/15 2:24 AM, Geo DrinX wrote: Hello, there is a way to load a QLR file with pyQGIS ? I tried using vlayer.loadNamedStyle(qlrFileName)but it seems not to work. What is the correct way ? That is the correct way. Have you done the following after applying the style?: