[QGIS-Developer] Enumerating QGIS data sources using python

Nyall Dawson nyall.dawson at gmail.com
Sun Nov 17 19:42:37 PST 2019


On Wed, 13 Nov 2019 at 21:55, Bo Victor Thomsen
<bo.victor.thomsen at gmail.com> wrote:
>
> Hi list members --
>
> Is it possible to enumerate the data sources shown in the QGIS "Data
> Source Manager" dialog, tab"Browser" using python ?  I can't find any
> documentation for it.
>
> My intension was to enumerate file-based datasources in a particular
> directory and maybe further enumerate through a specific file in the
> chosen directory (ex. a geopackage) containing several data layers.

You could access this through the browser model -- it's exposed to
python via iface.browserModel().

Nyall


>
> --
> Med venlig hilsen / Kind regards
>
> Bo Victor Thomsen
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list