Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 726
Talguy Avatar asked Dec 15 '10 16:12

Talguy


1 Answers

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

like image 56
DrAl Avatar answered Oct 06 '22 05:10

DrAl