Hi all
i'm writing a pyhton plugin for adding vector layers. The layers are choosen in
a dialog and then loaded into the toc and the canvas:
uri = QgsDataSourceURI()
uri.setConnection(self.DBHOST, self.DBPORT, self.DBNAME, self.DBUSER, "")
uri.setDataSource("public","table_foo","wkb_geometry")
vLayer = QgsVectorLayer(uri.uri(), "myLayer", "postgres")
QgsMapLayerRegistry.instance().addMapLayer(vLayer)
This works fine. My question is now, how may I add the layers in a group in the
toc? In the layer list you may right click and then add a group and then you
may add your layers in the group. That's what I like to do directly with my
plugin.
Is this possible, and if yes, may someone point me to right place in the docs?
regards
Cédric
mit freundlichen Grüssen
Cédric Möri
GIS-Informatiker
--
Kanton Solothurn
Bau- und Justizdepartement
Amt für Geoinformation
Rötistrasse 4
4501 Solothurn
Telefon: +41 (0)32 627 24 75
Telefax: +41 (0)32 627 22 14
mailto:[email protected]
http://www.agi.so.ch
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user