big_number: refactor data_changed

This commit is contained in:
Simon Renblad 2023-07-12 12:03:29 +08:00 committed by Sébastien Bourdeauducq
parent 5695e9f77e
commit 25959d0cd6

View File

@ -61,9 +61,9 @@ class NumberWidget(QtWidgets.QStackedWidget):
def cancel_edit(self):
self.setCurrentWidget(self.lcd_widget)
def data_changed(self, data, mods):
def data_changed(self, value, metadata, persist, mods):
try:
n = float(data[self.dataset_name][1])
n = float(value[self.dataset_name])
except (KeyError, ValueError, TypeError):
n = "---"
self.lcd_widget.display(n)