movetothread
thread=new qthread
this. move to thread(thread)
timer. movetothread(thread)如果不写这句,那么timer的信号发送是不会被阻塞的,导致信号累积,thread不会退出。
其实就是用的时候要注意一下
thread. start()
thread. quit()
thread. wait()
delete thread
信号 谁创建在谁的线程
槽函数 一样,除非用movetothread
本文探讨了在多线程环境中,如何正确管理线程与定时器的关系,特别是在使用movetothread方法时,确保定时器信号不会累积,避免thread无法正常退出的问题。
1万+

被折叠的 条评论
为什么被折叠?



