Feature request #16539
option to skip layer table panel if adding a geopackage to the project using the api
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||24445|
Currently if you use the api from a python plugin to add a geopackage to the project (as used in https://github.com/pka/qgpkg) a popup is displayed giving the option to select tables to add to the project. This is undesirable, since the plugin at that point already knows which layers it wants to add.
I suggest to extend the geopackage api to expose in the addVectorLayer method an optional parameter "tables" that, if filled, will override the popup and add the selected tables directly.
QGIS uses ogr to open a geopackage
the plugin is passing the file to GDAL/OGR, who is doing all the work
This is how a file can be opened
.addVectorLayer(gpkg_path, "", "ogr")
it calls a generic vector provider, and passes the OGR driver
for most cases, when you call this function, you get back one layer
But in the case of geopackage you get multiple layers; this is the issue