Don't useĀ <span style="line-height:19.7999992370605px">QgsLabel it is the old label engine and will be removed in the future.<br></span><br>- NathanĀ <br><div class="gmail_quote">On Fri Dec 05 2014 at 9:27:14 AM Tom Chadwin <<a href="mailto:tom.chadwin@nnpa.org.uk">tom.chadwin@nnpa.org.uk</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> QgsLabel(layer.pendingFields()<u></u>).fields()[0].name()<br>
<br>
That doesn't work - it gives the field at position 0, not the labelling<br>
field.<br>
<br>
> layer.customProperty("<u></u>labeling/fieldName")<br>
<br>
But this does work perfectly. Thank you so much.<br>
<br>
Tom<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Retrieve-field-name-used-as-label-tp5176293p5176555.html" target="_blank">http://osgeo-org.1560.x6.<u></u>nabble.com/Retrieve-field-<u></u>name-used-as-label-<u></u>tp5176293p5176555.html</a><br>
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
______________________________<u></u>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-<u></u>developer</a><br>
</blockquote></div>