progress_bar: refactor data_changed

This commit is contained in:
Simon Renblad 2023-07-12 12:06:29 +08:00 committed by Sébastien Bourdeauducq
parent 6c588b83d7
commit 068a2d1663
1 changed files with 4 additions and 4 deletions

View File

@ -12,12 +12,12 @@ class ProgressWidget(QtWidgets.QProgressBar):
self.setMaximum(args.max)
self.dataset_value = args.value
def data_changed(self, data, mods):
def data_changed(self, value, metadata, persist, mods):
try:
value = round(data[self.dataset_value][1])
val = round(value[self.dataset_value])
except (KeyError, ValueError, TypeError):
value = 0
self.setValue(value)
val = 0
self.setValue(val)