slint
slint copied to clipboard
MapModel is missing set_row_data() function
trafficstars
The C++ classes of SortModel, FilterModel, VectorModel, all have set_row_data() implemented. However, MapModel is missing the same.
So if we try to update any item from UI, we get the warning -
Model::set_row_data was called on a read-only model
This is not possible with the current API. Suppose that you have a map model that converts from your own C++ data structure Foo to a slint_interpreter::Value: If set_row_data is called with a slint_interpreter::Value, MapModel canot know how to convert it back to Foo.
So this would require new API where the user also provides a function that maps the other way around, a bi-directional map model.