Skip to content

Support for UI in non-main thread #1277

Answered by ogoffart
akiross asked this question in General
Discussion options

You must be logged in to vote

The idea is that slint runs in the main thread, and you can then communicate with a thread using message queue, for example.

And example of this is Cargo-UI, if you have not seen it. The idea is that each callback sends message to the thread like so:
https://github.com/slint-ui/cargo-ui/blob/3e2780dbffc9f123fc5205ffe242805d887f49ad/src/main.rs#L59
Then the thread intercept the message, do the processing, and communicate the result back with invoke_from_event_loop, or Weak::upgrade_in_event_loop https://github.com/slint-ui/cargo-ui/blob/3e2780dbffc9f123fc5205ffe242805d887f49ad/src/cargo.rs#L513

Is the Qt backend able to run inside a non-main thread (on linux)?

I do think that works on Li…

Replies: 1 comment

Comment options

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