update internal fit infos after function removal
This commit is contained in:
parent
d9f1c0b8c2
commit
ff2ff01da7
@ -12,12 +12,13 @@ from ..lib.forms import SelectionWidget
|
||||
class QFitParameterWidget(QtWidgets.QWidget, Ui_FormFit):
|
||||
value_requested = QtCore.pyqtSignal(int)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
def __init__(self, func_id: int, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.func = None
|
||||
self.func_idx = None
|
||||
self.func_id = func_id
|
||||
self.max_width = QtCore.QSize(0, 0)
|
||||
self.global_parameter = []
|
||||
self.data_parameter = []
|
||||
@ -301,8 +302,10 @@ class ParameterSingleWidget(QtWidgets.QWidget):
|
||||
|
||||
self.name = name
|
||||
self.parametername.setText(convert(name))
|
||||
self.parametername.setToolTip('If this is bold then this parameter is only for this data. '
|
||||
'Otherwise, the general parameter is used and displayed')
|
||||
self.parametername.setToolTip(
|
||||
'If this is bold then this parameter is only for this data. '
|
||||
'Otherwise, the general parameter is used and displayed'
|
||||
)
|
||||
|
||||
# self.value_line.setValidator(QtGui.QDoubleValidator())
|
||||
self.value_line.textChanged.connect(lambda: self.valueChanged.emit(self.value) if self.value is not None else 0)
|
||||
|
@ -77,8 +77,12 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog):
|
||||
"""
|
||||
w = self.param_widgets[idx]
|
||||
self.stackedWidget.removeWidget(w)
|
||||
w.setParent(None)
|
||||
w.deleteLater()
|
||||
del self.param_widgets[idx]
|
||||
_, func_id = self.functionwidget.get_selected()
|
||||
|
||||
self.get_functions()
|
||||
|
||||
self._current_function = None
|
||||
if len(self.param_widgets) == 0:
|
||||
@ -104,7 +108,7 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog):
|
||||
if function is None:
|
||||
return
|
||||
|
||||
dialog = QFitParameterWidget(self.stackedWidget)
|
||||
dialog = QFitParameterWidget(function_id, self.stackedWidget)
|
||||
data_names = self.data_table.data_list(include_name=True)
|
||||
|
||||
dialog.set_function(function, function_idx)
|
||||
@ -206,9 +210,7 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog):
|
||||
|
||||
for m in self.models[model_id]:
|
||||
func_id = m['cnt']
|
||||
self.stackedWidget.removeWidget(self.param_widgets[func_id])
|
||||
|
||||
self.param_widgets.pop(func_id)
|
||||
self.remove_function(func_id)
|
||||
|
||||
self._complex.pop(model_id)
|
||||
self._func_list.pop(model_id)
|
||||
|
Loading…
Reference in New Issue
Block a user