<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><br class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Hi David, <br class=""></div><div class=""><br class=""></div><div class="">You  need an event loop to use a Q(qg)NetworkAccessManager, it's asynchronous.<br class=""></div><div class=""><br class=""></div></div></div></div></blockquote><div><br class=""></div><div>Hi Alessandro,</div><div><br class=""></div><div>Yes, we know that (see the second code in previous mail  ):  the  QgsNetworkAccessManager works perfeclty in python, this is not the point.</div><div><br class=""></div><div>The point is: trying to instanciate  a  wmsprovider will issue a timeout when trying to request the capabilities: the code responsible for that creates its own QEventLoop and manage to do a blocking call (which is expected here). </div><div>Please have a look at <a href="https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmscapabilities.cpp#L1964" class="">https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmscapabilities.cpp#L1964</a>.  What we do not understand is why, despite the call of loop.exec() in the c++ code, the request is not processed (my example with the  Q(gs)etworkAccessManager</div><div>shows that it should processed)</div><div><br class=""></div><div>Actually you cannot instanciate properly a QgsProject with a WMS layer.</div><div><br class=""></div><div>To convince yourself, try to instanciate a QgsProject in python (in a standalone python script) from a .qgs project having a single wms layer: it will fail to instanciate the layer.</div><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><br clear="all" class=""></div><br class="">-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Alessandro Pasotti<br class="">w3:   <a href="http://www.itopen.it/" target="_blank" class="">www.itopen.it</a></div>
</div></div>
</blockquote></div><br class=""></body></html>