[Qgis-developer] Basic question: How to select a layer in the GUI
and get the handle in the Python code?
ole.moller.nielsen at gmail.com
Wed Dec 7 08:28:28 EST 2011
Hi Alexander and mailing list
Thanks for the quick reply - it is great to have the support of this
If I understand you correctly, you want to access current selected layer,
> Use self.iface.mapCanvas().currentLayer() for this
Sorry, I was perhaps not as clear as I could have been. I have already
written plugins using the currentLayer option. What I need now is to
combine two layers for a specific analysis. So I imagine being able to
select them through the plugin GUI selection combos and return the two
layer handles to the Python code in the same format as what is provided by
current layer. However, I have no idea how to start doing this.
> > Also, is there such a thing as a reference manual for the python plugin
> Python API mainly the same as C++ API, so you can use C++ API from 
> Also there is PyQGIS Developer Cookbook  where you can find some code
Yes - I already read that and found it very helpful. However, nowhere to be
seen are explanations of the fundamentals of selecting layers through the
plugin and working with them.
Your help is much appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer