-
I'm quite new to Slint. Let's say I have a The closest example I've seen so far is actually a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Right, you will want to map the Vec to a Vec. let my_vec : Vec<String> = ...;
let my_vec : Vec<slint::SharedString> = my_vec.into_iter().map(Into::into).collect();
let model = slint::ModelRc::new(VecModel::from(vec!["Hello".into(), "World".into()]));
my_ui.set_some_property(model); (I haven't tried this code) If you want to automatically react to change in the vector, you may want to have a |
Beta Was this translation helpful? Give feedback.
Right, you will want to map the Vec to a Vec.
You can do something like so:
(I haven't tried this code)
If you want to automatically react to change in the vector, you may want to have a
Rc<VecModel<SharedString>>
instead and operate in that instead of on theVec<String>