From 57afee372fd8c79ed435c3bf2e0a90995378155a Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Sat, 30 Dec 2023 15:40:44 +0000 Subject: [PATCH] bugfix (#193) Co-authored-by: Dominik Demuth Reviewed-on: https://gitea.pkm.physik.tu-darmstadt.de/IPKM/nmreval/pulls/193 --- src/gui_qt/data/datawidget/datawidget.py | 3 +++ src/gui_qt/fit/fit_forms.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui_qt/data/datawidget/datawidget.py b/src/gui_qt/data/datawidget/datawidget.py index 34c19d9..45ffc52 100644 --- a/src/gui_qt/data/datawidget/datawidget.py +++ b/src/gui_qt/data/datawidget/datawidget.py @@ -532,11 +532,14 @@ class DataTree(QtWidgets.QTreeWidget): def uncheck_sets(self, sets: list[str]): self.blockSignals(True) iterator = QtWidgets.QTreeWidgetItemIterator(self) + self._checked_sets = set() while iterator.value(): item = iterator.value() if item is not None: if item.data(0, QtCore.Qt.UserRole) in sets: item.setCheckState(0, QtCore.Qt.Unchecked) + else: + self._checked_sets.add(item.data(0, QtCore.Qt.UserRole)) iterator += 1 self.blockSignals(False) diff --git a/src/gui_qt/fit/fit_forms.py b/src/gui_qt/fit/fit_forms.py index 624b13d..4b696c5 100644 --- a/src/gui_qt/fit/fit_forms.py +++ b/src/gui_qt/fit/fit_forms.py @@ -77,9 +77,11 @@ class FitModelWidget(QtWidgets.QWidget, Ui_FitParameter): if bds is not None: self.set_bounds(*bds) - self.fixed_check.setCheckState(QtCore.Qt.CheckState.Unchecked if fixed else QtCore.Qt.CheckState.Checked) + if fixed is not None: + self.fixed_check.setCheckState(QtCore.Qt.CheckState.Unchecked if fixed else QtCore.Qt.CheckState.Checked) - self.global_checkbox.setCheckState(QtCore.Qt.CheckState.Checked if glob else QtCore.Qt.CheckState.Unchecked) + if glob is not None: + self.global_checkbox.setCheckState(QtCore.Qt.CheckState.Checked if glob else QtCore.Qt.CheckState.Unchecked) def get_parameter(self): try: