<div dir="ltr"><div>Very strange   :(<br><br></div>I inserted also the    triggerRepaint()   but nothing changes.<br><div><div><br></div><div>This is my sourcecode:<br><br><a href="https://github.com/geodrinx/smartroadsense/blob/master/smartroadsense.py">https://github.com/geodrinx/smartroadsense/blob/master/smartroadsense.py</a><br><br><br></div><div>If I drag and drop in  QGIS  my  "srs_data.qlr"   file, it works.<br></div><div><br>Instead, from python code, the style is not applied.<br><br></div><div><span id="result_box" class="" lang="en"><span class="">Could</span> <span class="">be because</span> <span class="">my</span> <span class="">data file is</span> <span class="">a</span> <span class="">CSV</span><span> ?</span></span></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-15 18:39 GMT+02:00 Gary Sherman <span dir="ltr"><<a href="mailto:gsherman@geoapt.com" target="_blank">gsherman@geoapt.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 4/15/15 2:24 AM, Geo DrinX wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
<br>
there is a way to load a QLR file with  pyQGIS ?<br>
<br>
I tried using      vlayer.loadNamedStyle(<u></u>qlrFileName)    but it seems<br>
not to work.<br>
<br>
<br>
What is the correct way ?<br>
<br>
</blockquote></div></div>
That is the correct way. Have you done the following after applying the style?:<br>
<br>
vlayer.triggerRepaint()<br>
<br>
You can test the result of applying the style using:<br>
<br>
result = vlayer.loadNamedStyle(<u></u>qlrFileName)<br>
<br>
If result if False, the style was not loaded/applied.<br>
<br>
-gary<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you<br>
<br>
Roberto<br>
<br>
<br>
______________________________<u></u>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-<u></u>developer</a><br>
<br>
</blockquote>
<br>
-- <br>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>
Gary Sherman<br>
<br>
Founder, QGIS Project<br>
Consulting: <a href="http://geoapt.com" target="_blank">geoapt.com</a><br>
Publishing: <a href="http://locatepress.com" target="_blank">locatepress.com</a><br>
<br>
We work virtually anywhere<br>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>
______________________________<u></u>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-<u></u>developer</a><br>
</blockquote></div><br></div>