Talguy
Talguy

Reputation: 1095

Qt Signals/Slots and Threads

I'm new to GUI programming and multithreading. I am in the process of creating a real-time app that receives information from my car and renders it in some meaningful way. My app is layed out as 3 threads, the GUI (main thread), the rendering thread and the hardware comm thread. Inbetwen the the render and the hardware threads is a shared ring buffer. In the render I have created a timer so that it draws the new interface 20 times a second. I would like the thread to notify the main thread that there is a new screen available and I was thinking a signal/slots method would work the best for this. This gets down to my question. When my render calls a slot, say Screen_Avalable, that is in my main window object in the main thread, does this slot/method get processed in my worker thread or the main thread?

Upvotes: 5

Views: 3000

Answers (2)

DrAl
DrAl

Reputation: 72626

It gets processed in the main thread by default, but see this guide for more information.

Upvotes: 4

badgerr
badgerr

Reputation: 7982

It gets processed on the main thread.

Upvotes: 2

Related Questions