I currently have a property in-out property <[{file:File,rows:[Row]}]> all_rows; that works perfectly fine when when I update it using ui.set_all_rows(), but if I make it multi-threaded it returns this error, and this is regardless if I use a Mutex or simply using as_any().downcast_ref.
std::rc::Rc<(dyn Model<Data = slint_generatedAppWindow::Row> + 'static)> cannot be sent between threads safely
Here's the code block using Rust:
ui_handle.upgrade_in_event_loop(move |h|{
let model_handle: ModelRc<(File, ModelRc<Row>)> = h.get_all_findings();
let model = model_handle.as_any().downcast_ref::<VecModel<(File, ModelRc<Row>)>>().unwrap();
model.push(file_rows);
});
I currently have a property
in-out property <[{file:File,rows:[Row]}]> all_rows;
that works perfectly fine when when I update it usingui.set_all_rows()
, but if I make it multi-threaded it returns this error, and this is regardless if I use a Mutex or simply usingas_any().downcast_ref.
std::rc::Rc<(dyn Model<Data = slint_generatedAppWindow::Row> + 'static)> cannot be sent between threads safely
Here's the code block using Rust:
Would this be easy to implement?