Hi List<br><br>I have not found any function in QgsMapLayer for getting a layer by its name. I needed it on a python plugin to let the user choose a layer from a combo box (already populated with the layer names)<br>So I created this function <a href="http://osgeo.pastebin.com/7EpNA3JL">http://osgeo.pastebin.com/7EpNA3JL</a><br>
<br>I have some questions regarding it:<br>* Is it the right way ?<br>* I have seen it is possible in Qgis to rename a layer, and 2 layers of the same type can have the same name. This makes my function not working in all the cases (which is my problem of course). Is there a reason to allow layers to share a name ?<br>
<br>Thanks for all the work done in Qgis<br><br>Cheers<br><br>Kimaidou<br><br><br>