<div dir="ltr"><div>You need to clarify if you want to remove all layers based on XYZ which are loaded in the current project</div><div>Or if you want to remove all XYZ connections which are in the Browser Panel?</div><div><br></div><div>It's two different things.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 23 sept. 2020 à 17:39, 1520 gis <<a href="mailto:juliermeopensourcedeveloper@gmail.com">juliermeopensourcedeveloper@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear all,<div><br></div><div>I am writing a PyQT5 QGIS Plugin to wipe out all xyz connections available in QGS projects.</div><div><br></div><div>I wrote the code below, but I am not achieving my goal and I did not understand the structure of xyz connections.</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";font-size:24px;line-height:32px;white-space:pre-wrap"><div><span style="color:rgb(86,156,214)">def</span> <span style="color:rgb(220,220,170)">removeAllConnectionsXYZ</span>(<span style="color:rgb(156,220,254)">self</span>):</div><div>        s = QSettings()</div><div>        xyz = <span style="color:rgb(206,145,120)">'qgis/connections-xyz'</span></div><div>        groupsXYZ = s.childGroups()</div><br><div>        <span style="color:rgb(197,134,192)">for</span> group <span style="color:rgb(86,156,214)">in</span> groupsXYZ:</div><div>            s.beginGroup(xyz)</div><div>            s.remove(<span style="color:rgb(206,145,120)">""</span>)</div><div>            s.endGroup()</div><div><div style="line-height:32px"><div><span style="color:rgb(86,156,214)">self</span>.dlg.wipeAllConnectionsXyz.clicked.connect(</div><div>                <span style="color:rgb(86,156,214)">self</span>.removeAllConnectionsXYZ)</div><div><br></div><div><br></div><div><br></div><div><br></div><div># Any comment will be very appreciated.</div><div><br></div><div>#Thank you for your time in advance</div><div><br></div><div>#Julierme</div></div></div></div></div></div>
_______________________________________________<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>