[QGIS-Developer] Update layer styling panel using Python

Anita Graser anitagraser at gmx.at
Sun Mar 8 13:10:58 PDT 2020


Hi,

After changing a layer's symbology using Python, how can I update the layer
styling panel to reflect the changes? I'm specifically asking because
data-defined overrides are not displayed after

exp = 'coalesce(scale_exp("pop_max", 0, 10000000, 0, 7, 0.57), 0)'
vlayer.renderer().symbol().symbolLayer(0).setDataDefinedProperty(
    QgsSymbolLayer.PropertySize, QgsProperty.fromExpression(exp) )
vlayer.triggerRepaint()

Regards,
Anita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200308/086f04e1/attachment.html>


More information about the QGIS-Developer mailing list