2

Attributes values are changed in a Python plug-in (QGIS 2.14/18) when the user clicks on the canvas. The opened view of the attribute table of the changed feature does not show the changed value even if the reload table icon is selected, only if I close and reopen the attribute table. While the info tool show the new correct value. How can I force the attribute table window to refresh? The attribute is changed like this:

layer.startEditing()
layer.dataProvider().changeAttributeValues(...)
layer.commitChanges()
2

Changing to the layer.changeAttributeValue() solved my problem:

layer.startEditing()
layer.changeAttributeValue(...)
layer.commitChanges()

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.