i'm new to qt stuff, 开发者_StackOverflow中文版in my project i need to send some stuff periodically using threads. so the only way in qt is to use qttimer and qtthreads such that on every timeout i will create a thread to send out my stuff? is this the logical way to do it? thanks!
You don't need to use a QThread if you are using a timer. QTimer already works asynchronously so launching a thread from it wouldn't be useful.
You can use a timer in a separate thread.
In the thread's run
function, create a QTimer
and set it to trigger your desired slot. Then call exec
to start a message loop in the thread to handle signals.
精彩评论