[Qgis-user] PyQGIS: wipe all xyz connections

Etienne Trimaille etienne.trimaille at gmail.com
Wed Sep 23 09:45:41 PDT 2020


You need to clarify if you want to remove all layers based on XYZ which are
loaded in the current project
Or if you want to remove all XYZ connections which are in the Browser Panel?

It's two different things.

Le mer. 23 sept. 2020 à 17:39, 1520 gis <
juliermeopensourcedeveloper at gmail.com> a écrit :

> Dear all,
>
> I am writing a PyQT5 QGIS Plugin to wipe out all xyz connections available
> in QGS projects.
>
> I wrote the code below, but I am not achieving my goal and I did not
> understand the structure of xyz connections.
>
> def removeAllConnectionsXYZ(self):
> s = QSettings()
> xyz = 'qgis/connections-xyz'
> groupsXYZ = s.childGroups()
>
> for group in groupsXYZ:
> s.beginGroup(xyz)
> s.remove("")
> s.endGroup()
> self.dlg.wipeAllConnectionsXyz.clicked.connect(
> self.removeAllConnectionsXYZ)
>
>
>
>
> # Any comment will be very appreciated.
>
> #Thank you for your time in advance
>
> #Julierme
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200923/a6d667f6/attachment.html>


More information about the Qgis-user mailing list