function with deactivated children

This commit is contained in:
Dominik Demuth 2024-01-19 19:04:39 +01:00
parent 465fb0c09a
commit 625af5ec71
2 changed files with 8 additions and 3 deletions

View File

@ -70,7 +70,7 @@ class FitModelTree(QtWidgets.QTreeWidget):
self.remove_function(item) self.remove_function(item)
elif evt.key() == QtCore.Qt.Key.Key_Space: elif evt.key() == QtCore.Qt.Key.Key_Space:
for item in self.treeWidget.selectedItems(): for item in self.selectedItems():
cs = item.checkState(0) cs = item.checkState(0)
if cs == QtCore.Qt.CheckState.Unchecked: if cs == QtCore.Qt.CheckState.Unchecked:
item.setCheckState(0, QtCore.Qt.CheckState.Checked) item.setCheckState(0, QtCore.Qt.CheckState.Checked)

View File

@ -26,8 +26,13 @@ class ModelFactory:
if func['children']: if func['children']:
right, _, _ = ModelFactory.create_from_list(func['children'], left_cnt=func['pos'], right, _, _ = ModelFactory.create_from_list(func['children'], left_cnt=func['pos'],
func_order=func_order, param_len=param_len) func_order=func_order, param_len=param_len)
right_cnt = None
right = MultiModel(func['func'], right, func['children'][0]['op'], left_idx=func['cnt'], right_idx=None) if right is None:
right = func['func']
right_cnt = func['cnt']
else:
right_cnt = None
right = MultiModel(func['func'], right, func['children'][0]['op'], left_idx=func['cnt'], right_idx=None)
else: else:
right = func['func'] right = func['func']
right_cnt = func['cnt'] right_cnt = func['cnt']