<div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie., 1 mar. 2019 a las 9:41, Stefan Giese (<<a href="mailto:Stefan.Giese@wheregroup.com">Stefan.Giese@wheregroup.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Reginald,<br>
<br>
strange, because for me it works having the qml and shapefile in the <br>
same directory with the same names (QGIS 3.6, Windows).<br></blockquote><div>Same for me on 3.6. All works fine. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Best regards<br>
<br>
Stefan<br>
<br>
Mit freundlichen Grüßen<br>
Stefan Giese<br>
Projektleiter/Consultant<br>
****************************************************************************<br>
FOSS Academy Kompaktkurs "Winterschule 2019"<br>
Grundwissen zum Aufbau von Geodateninfrastrukturen mit Open-Source-Software<br>
<a href="https://foss-academy.com/kompaktkurse" rel="noreferrer" target="_blank">https://foss-academy.com/kompaktkurse</a><br>
****************************************************************************<br>
WhereGroup GmbH & Co. KG<br>
Schwimmbadstr. 2<br>
79100 Freiburg<br>
Germany<br>
<br>
Fon: +49 (0)761 / 519 102 - 61<br>
Fax: +49 (0)761 / 519 102 - 11<br>
<br>
<a href="mailto:stefan.giese@wheregroup.com" target="_blank">stefan.giese@wheregroup.com</a><br>
<a href="http://www.wheregroup.com" rel="noreferrer" target="_blank">www.wheregroup.com</a><br>
Amtsgericht Bonn, HRA 6788<br>
-------------------------------<br>
Komplementärin:<br>
WhereGroup Verwaltungs GmbH<br>
vertreten durch:<br>
Olaf Knopp, Peter Stamm<br>
-------------------------------<br>
<br>
Am 01.03.2019 um 09:23 schrieb Reginald:<br>
> Hello list,<br>
><br>
> I have a whole series of shapefiles and qml files residing in the same<br>
> directory.<br>
> The shapefiles and the qmlfiles have according names: eg.<br>
> Adp36007.shp --> Adp36007.qml<br>
> I have read somewhere that those qml files would be applied automaticaly<br>
> when I load the shapefiles in the map. That doesn't happen.<br>
> So I wrote a quick script:<br>
><br>
> from qgis.PyQt.QtCore import *<br>
> from qgis.PyQt.QtGui import *<br>
> from qgis.PyQt.QtWidgets import *<br>
> from qgis.utils import iface<br>
> from qgis.core import *<br>
><br>
> layers = [layer for layer in QgsProject.instance().mapLayers().values()]<br>
> dirname = "F:/GRB/Recent/"<br>
> for lay in layers:<br>
>      qmlname = dirname + <a href="http://lay.name" rel="noreferrer" target="_blank">lay.name</a>() + ".qml"<br>
>      lay.loadNamedStyle(qmlname)<br>
>      print("processed " + qmlname)<br>
>      lay.triggerRepaint()<br>
> print("done")<br>
><br>
> But that doesn't work. Applying the qml via the GUI works so there is<br>
> nothing wrong with the qml files.<br>
> Has anything changed in QGIS 3.4 with loadNamedStyle?<br>
><br>
> Regards,<br>
><br>
><br>
><br>
> --<br>
> Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html</a><br>
> _______________________________________________<br>
> Qgis-user mailing list<br>
> <a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Francisco Pérez Sampayo</div></div>