[Qgis-developer] Retrieve field name used as label

Nathan Woodrow madmanwoo at gmail.com
Thu Dec 4 15:30:09 PST 2014


Don't use QgsLabel it is the old label engine and will be removed in the
future.

- Nathan
On Fri Dec 05 2014 at 9:27:14 AM Tom Chadwin <tom.chadwin at nnpa.org.uk>
wrote:

> > QgsLabel(layer.pendingFields()).fields()[0].name()
>
> That doesn't work - it gives the field at position 0, not the labelling
> field.
>
> > layer.customProperty("labeling/fieldName")
>
> But this does work perfectly. Thank you so much.
>
> Tom
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.
> nabble.com/Retrieve-field-name-used-as-label-tp5176293p5176555.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20141204/408094fa/attachment.html>


More information about the Qgis-developer mailing list