Skip to content

Qt signal/slot solution in slint/rust #3030

Answered by ogoffart
kkettinger asked this question in General
Discussion options

You must be logged in to vote

I see that I similar question was asked on reddit: https://www.reddit.com/r/rust/comments/14osg13/rust_equalivalent_of_qt_signalslots/

In Rust, you'd probably use async programming with tokio in your threads.
So you'd have the Slint event loop running in the main thread (the UI thread), and you would have an async executor running in the other thread (for example tokio), but it could also be some loop waiting for message or something.

Anyway, from your thread, you would use slint::invoke_from_event_loop to run code in the UI thread (update the UI)
There is an example in https://docs.rs/slint/latest/slint/fn.invoke_from_event_loop.html

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kkettinger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants