[Qgis-developer] Help Needed in retrieving file path from the layer name

motta.luiz at gmail.com motta.luiz at gmail.com
Tue May 18 10:22:33 EDT 2010


Bishwarup Banerjee,

You can use the method QgsLayer.source()

I use this methods in the Spatial Query plugin:
https://trac.osgeo.org/qgis/browser/trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
line 382 for populate ToolTipRole item in combobox



Bishwarup Banerjee escreveu:
> Dear All,
>
> Is there any way to get the entire file path from the layer name?
> For example:
>
> A user selects a layer inside a combobox, which in turn accesses the 
> map layer registry.
> Now I want to know the full path of the layer selected.
> If the layer name through combobox is "xyz"
> Then I want to get "c:/aa/bb/xyz.shp" or the exact location of the 
> layer, in the harddisk.
>
> Any help regarding this will be highly helpful and appreciated.
>
> With Warm Regards,
> Sonai
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>   



More information about the Qgis-developer mailing list