When I change symbology for a given QgsVectorLayer (QGIS 2.14.16 LTR) by


as shown here:

enter image description here

and refreshing the map content by


I get the expected result, but the Layer Tree does not update as shown here:

enter image description here

What am I missing, and how can I update the Layer tree from PyQGIS programmatically?


Tell the layer tree view to refresh your layer's symbology:

iface.layerTreeView().refreshLayerSymbology( iface.activeLayer().id() )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.