data list in QEvalDialog uses current names instead of stored

This commit is contained in:
Dominik Demuth 2023-04-19 19:43:04 +02:00
parent efd5b34b13
commit eba7869c4d

View File

@ -37,13 +37,12 @@ class QEvalDialog(QtWidgets.QDialog, Ui_CalcDialog):
tmp.append(self.listWidget.takeItem(0))
for set_id, name in data:
# search if set was used before
new_one = True
for i in range(len(tmp)):
w = tmp[i]
if w.data(QtCore.Qt.UserRole) == set_id:
w.setText(name)
self.listWidget.addItem(w)
tmp.pop(i)
new_one = False
@ -60,7 +59,7 @@ class QEvalDialog(QtWidgets.QDialog, Ui_CalcDialog):
while len(tmp):
# delete remaining ListWidgetItems
w = tmp.pop()
w.deleteLater()
del w
def set_graphs(self, graphs: list):
self.graph_comboBox.clear()