简体   繁体   中英

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?

默认情况下,它将在主线程中进行处理,但请参阅本指南以获取更多信息。

它在主线程上进行处理。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM