Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapModel is missing set_row_data() function #5290

Open
aamer-shaikh opened this issue May 23, 2024 · 1 comment
Open

MapModel is missing set_row_data() function #5290

aamer-shaikh opened this issue May 23, 2024 · 1 comment
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:language-javascript JavaScript bindings (mF,bS) a:language-python Python bindings (mS,bO) a:language-rust Rust API and codegen (mO,mS) api Changes or additions to APIs enhancement New feature or request

Comments

@aamer-shaikh
Copy link

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

@tronical
Copy link
Member

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.

@tronical tronical added enhancement New feature or request api Changes or additions to APIs a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:language-rust Rust API and codegen (mO,mS) a:language-javascript JavaScript bindings (mF,bS) a:language-python Python bindings (mS,bO) labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:language-javascript JavaScript bindings (mF,bS) a:language-python Python bindings (mS,bO) a:language-rust Rust API and codegen (mO,mS) api Changes or additions to APIs enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants