Here is another problem I have encountered converting a plugin from QGIS 2
to 3.

In my plugin I want to automatically create a point layer and have the
point labeled. Here is how I used to do it:

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

label.setDataDefinedProperty(QgsPalLayerSettings.Size,True,True,'9','')
            label.writeToLayer(ptLayer)

In QGIS 3 setDataDefinedProperty() is no longer a method. It looks like it
has been replaced with setDataDefinedProperties()

How do I set the font size in QGIS 3 similar to what I was doing in QGIS 2?

Thanks!!!
_______________________________________________
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