diff --git a/src/View/LateralContribution/Table.py b/src/View/LateralContribution/Table.py index e5c533dd..56eb70e2 100644 --- a/src/View/LateralContribution/Table.py +++ b/src/View/LateralContribution/Table.py @@ -94,7 +94,10 @@ class ComboBoxDelegate(QItemDelegate): else: self.editor.addItems( list( - map(str, self._data.reach.get_rk()) + map( + lambda p: p.display_name(), + self._data.reach.profiles + ) ) ) else: @@ -112,7 +115,20 @@ class ComboBoxDelegate(QItemDelegate): def setModelData(self, editor, model, index): text = str(editor.currentText()) - model.setData(index, text) + + if self._mode == "rk": + profiles = list( + filter( + lambda p: p.display_name() == text, + self._data.reach.profiles + ) + ) + + value = profiles[0].rk if len(profiles) > 0 else None + else: + value = text + + model.setData(index, value) editor.close() editor.deleteLater()