Fit: Ignore complex_state, if no complex function is selected; closes #144
This commit is contained in:
@ -235,7 +235,19 @@ class QFunctionWidget(QtWidgets.QWidget, Ui_Form):
|
||||
return all_parameters
|
||||
|
||||
def get_complex_state(self):
|
||||
return self.complex_comboBox.currentIndex() if self.iscomplex else None
|
||||
iscomplex = False
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self.functree)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
if item.checkState(0) != QtCore.Qt.CheckState.Unchecked:
|
||||
f = self.functions[item.data(0, QtCore.Qt.UserRole)]
|
||||
if hasattr(f, 'iscomplex') and f.iscomplex:
|
||||
iscomplex = True
|
||||
break
|
||||
|
||||
iterator += 1
|
||||
|
||||
return self.complex_comboBox.currentIndex() if iscomplex else None
|
||||
|
||||
def set_complex_state(self, state):
|
||||
if state is not None:
|
||||
|
Reference in New Issue
Block a user