Formally I was using the following in my code to add a default label to my
points vector layer:

            label = QgsPalLayerSettings()
            label.readFromLayer(ptLayer)
            label.enabled = True
            label.fieldName = 'label'
            label.placement= QgsPalLayerSettings.AroundPoint
            label.writeToLayer(ptLayer)

In looking at the api break documentation readFromLayer and writeToLayer
have been removed and I need to somehow use QgsAbstractVectorLayerLabeling,
but I cannot see what I need to change just to add a label to my point
layer. I am not trying to do anything fancy. All I want is to specify a
field to be used to label the points layer and just use the default
styling. Any help understanding the new API changes would be appreciated.

Thanks,

Calvin
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to