qthread destroyed while thread is still running
然后报错(windows下):QThread: Destroyed while thread is still running,程序直接崩溃
解决办法:在select_t.start()后面跟一句select_t.exec()保护一下
select_t = SelectModuleThread() # 通过创建一个继承QThread的类的线程对象
select_t.my_signal.connect(self.set_num) # 线程对象绑定信号
select_t.start() # 线程启动
select_t.exec()
exec()在官方文档中的属性是protected,作用为使线程进入时间循环状态,并且处于wait状态,直到退出。