Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.12.0
-
None
-
f462312365d4955fc82b247b72f84e1c77d8104d (qt/qtquickcontrols2/dev)
Description
ComboBox already has a textRole, to simplify user code when dealing with a model having multiple roles, ComboBox should also have a valueRole.
We could add these properties and function:
- writable valueRole : similar to textRole
- readonly currentValue: similar to currentText
- findValue function: similar to the find function
Usage could then be:
ComboBox { model: [ {value: SomeEnum.One, text: "One"}, {value: SomeEnum.Two, text: "Two"}] textRole: "text" valueRole: "value" currentIndex: findValue(someBusinessObject.value) onActivated: someBusinessObject.value = currentValue }
Attachments
Issue Links
- relates to
-
QTBUG-76029 REG: Performance regression in Quick Controls 2 Combo Box
- Closed
-
QTBUG-73489 Add icons to ComboBox
- Open