In some cases, when one creates a TaurusValueCombobox and sets the model after having called addValueNames, the widget is left in an inconsistent "pending operations" state (the write value shown is the same as the one applied, but the widget reports having pending operations -i.e. it is "blue")
Note: Here is the code I use to reproduce it. Unfortunately, I haven't managed to reproduce this using TangoTest.
import sys import taurus from taurus.qt.qtgui.application import TaurusApplication from taurus.qt.qtgui.input import TaurusValueComboBox #model = 'sys/tg_test/1/boolean_scalar' model = 'sr10/rf/lyrtechdllrf-b01/loopenable' names = [ ('Off', False), ('On', True), ] #taurus.Attribute(model).write(True) a = TaurusApplication([]) w = TaurusValueComboBox() #w.setModel(model) w.addValueNames(names) w.setModel(model) w.show() sys.exit(a.exec_())
To solve this it is enougth to add a call to emitValueChanged() at the end of the setModel method. I'll send a patch to the devel list.
Patch sent by CarlosP was applied to develop
Ticket moved from /p/sardana/tickets/242/
Can't be converted: