From 1678152836dd167ca43b44cf1fb6d7483f9b6e48 Mon Sep 17 00:00:00 2001 From: Stephen Nneji Date: Wed, 30 Oct 2024 10:06:15 +0000 Subject: [PATCH] Fixes for strategy enum bug --- rascal2/widgets/inputs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rascal2/widgets/inputs.py b/rascal2/widgets/inputs.py index 16c760a..78cf285 100644 --- a/rascal2/widgets/inputs.py +++ b/rascal2/widgets/inputs.py @@ -146,13 +146,14 @@ def create_editor(self, field_info: FieldInfo) -> QtWidgets.QWidget: class EnumInputWidget(BaseInputWidget): """Input widget for Enums.""" - data_getter = "currentText" + data_getter = "currentData" data_setter = "setCurrentText" edit_signal = "currentTextChanged" def create_editor(self, field_info: FieldInfo) -> QtWidgets.QWidget: editor = QtWidgets.QComboBox(self) - editor.addItems(str(e) for e in field_info.annotation) + for e in field_info.annotation: + editor.addItem(str(e), e) return editor