[Qgis-developer] Basic question: How to select a layer in the GUI
and get the handle in the Python code?
Alexander Bruy
alexander.bruy at gmail.com
Fri Dec 9 06:45:11 EST 2011
Hi Ole,
2011/12/9 Ole Nielsen <ole.moller.nielsen at gmail.com>:
> With that loaded layer names show up in the combo and after selection the
> fully qualified filename is returned by layer.source()
>
> However, if I want a handle to an active layer, like I got
> with self.iface.mapCanvas().currentLayer() is there any way that could be
> obtained from the layer object?
as I see you use code from Giuseppe. If you want to get
layer object use my function or modify your existing code.
You need to create a QgsVectorLayer object from layer's
source.
--
Alexander Bruy
NextGIS
More information about the Qgis-developer
mailing list