2021
04-07
04-07
PyQt5 QThread倒计时功能的实现代码
1.创建多线程类全局变量secclasswork_thread(QThread):timer=pyqtSignal()#每隔一秒发送信号end=pyqtSignal()#计数完成发送信号defrun(self)->None:whileTrue:self.sleep(1)ifsec==0:self.end.emit()#发送end信号breakself.timer.emit()2.实例化线程类,绑定计数,技术结束事件self.label.setText("20")globalsecsec=20self.work_thread=work_thread()self.work_thread.timer.conne...
继续阅读 >