Skip to content

Commit

Permalink
Fixes for strategy enum bug
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenNneji committed Oct 30, 2024
1 parent 3266bd1 commit 1678152
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rascal2/widgets/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1678152

Please sign in to comment.