Hi,

I have a QGIS form with a number of widgets that are set to "disabled". I don't want the user to change these values manually, but they should be updated by a Python action "on demand". Hence I set the editable state of these widgets to False.

Now I noticed that while I can change values in the widgets with my Python action, the values are not stored when the editable state is set to "False". As soon as I set the editable state to "True", then my Python action works fine and the values are correctly stored.

I tried with two approaches:

QgsAttributeForm.changeAttribute()

and

QgsWidget.setValue()

Both of these work fine when editable state is enabled, but not, when they are disabled.

Is there any way to also change attribute values when the editable state of a widget is set to False?

Thanks,

Andreas
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to