GUI: block signal in numberlineedit when update-value or force_update-value is called

This commit is contained in:
martinappleby committed 2025-11-07 14:00:57 +01:00
1 parent f3b798b770
commit 39322cde80
1 file changed
+4
@@ -62,13 +62,17 @@ class NumberLineEdit(QLineEdit):
@Slot(float)
def update_value(self, val: float):
if abs(val - self.saved_value) > 0.001:
self.blockSignals(True)
self.saved_value = val
self.setText(self.to_string(val))
self.blockSignals(False)
def force_update_value(self, val: float):
# Always update text and saved_value
self.blockSignals(True)
self.saved_value = val
self.setText(self.to_string(val))
self.blockSignals(False)
@Slot(float, float)
def update_limits(self, min_val: float, max_val: float):