Hi Richard,

Le 11/04/2014 12:01, Richard Duivenvoorde a écrit :
> Hi,
> 
> having a python plugin which is supposed to check if there are labels I
> use someting like this (python console):
> 
> iface.mapCanvas().currentLayer().hasLabelsEnabled()
> 
> (for an active simple point vector layer loaded)
> 
> But this always return False
> 
> is this method not working anymore because we switched label enginges?

Yes, exactly.
I think you should call something like :

settings = QgsPalLayerSettings()
settings.readFromLayer( layer )
if layer.enabled: ...

-- 
Hugo Mercier
Oslandia
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to