Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
Description
When in a delegate, it's easy to read (and have bindings to) and write model data:
Slider { value: model.someValue onMoved: model.someValue = value }
If you want to have an editor that is equivalent to a delegate but only shows the current item, it's less convenient:
Slider { value: view.currentIndex !== -1 ? view.model.data(view.model.index(view.currentIndex, 0), Model.SomeValueRole) : 0 onMoved: view.model.setData(view.model.index(view.currentIndex, 0), value, Model.SomeValueRole) }
This assumes that you have an enum for the roles and that that enum is exposed to QML via Q_ENUM. It also doesn't react to changes to the current model data.
We should make this more convenient somehow.
Attachments
Issue Links
- is blocked by
-
QTBUG-82145 Improve/redesign models in QML
- Open
- relates to
-
QTBUG-82443 Value types and Containers in QML
- Closed