Multi-Threaded Nested Model Support #6735
Unanswered
Areopagitics
asked this question in
Q&A
Replies: 1 comment
-
The model is indeed not Send and I don't think it is possible to change that, because the view need to listen to change to the model to update itself, and this is really not something that can be done if the model changes in a thread. What should be done is that update to the model need to be done in the main thread. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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?
Beta Was this translation helpful? Give feedback.
All reactions