From ebf5ac8116c146b0a92d97c3da067aff214a9d8e Mon Sep 17 00:00:00 2001 From: jupfi Date: Thu, 13 Jul 2023 11:09:27 +0200 Subject: [PATCH] Fixed issue with updating of settings --- src/nqrduck_spectrometer/base_spectrometer_view.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nqrduck_spectrometer/base_spectrometer_view.py b/src/nqrduck_spectrometer/base_spectrometer_view.py index 816fa5c..3be71e7 100644 --- a/src/nqrduck_spectrometer/base_spectrometer_view.py +++ b/src/nqrduck_spectrometer/base_spectrometer_view.py @@ -1,4 +1,5 @@ import logging +from functools import partial from PyQt6.QtWidgets import QWidget, QLabel, QLineEdit, QHBoxLayout, QSizePolicy, QSpacerItem from nqrduck.module.module_view import ModuleView @@ -45,7 +46,8 @@ class BaseSpectrometerView(ModuleView): # Add a horizontal layout for the setting layout = QHBoxLayout() # Connect the editingFinished signal to the on_value_changed slot of the setting - line_edit.editingFinished.connect(lambda: setting.on_value_changed(line_edit.text())) + update_func = partial(setting.on_value_changed, line_edit.text()) + line_edit.editingFinished.connect(lambda x=line_edit: setting.on_value_changed(x.text())) # Add the label and the line edit to the layout layout.addItem(spacer) layout.addWidget(setting_label)