一般在pyqt4中的信号连接很少连接带参数的方法,很多时候连接带参数的方法节约不少代码量。
self.s5_thread=scene.Worker5() self.log_get=QtCore.QTimer()
self.connect(self.s5_thread, QtCore.SIGNAL("get_log_start()"), lambda thread=self.s5_thread: self.qtimer_get_log(thread)) def qtimer_get_log(self,thread):
self.log_get.singleShot(30000,thread.get_mem_error_logfile_content)
self.log_get.singleShot(90000,thread.get_mem_right_logfile_content)
self.log_get.start()
调用方式,在线程中发射信号调用
self.emit(QtCore.SIGNAL("get_log_start()"))