def run(self):
with QMutexLocker(self.mutex):
self.stoped = False
while True:
if self.stoped:
return
self.emit(SIGNAL(self.signal))
time.sleep(0.04) #40毫秒发送一次信号,每秒25帧
def stop(self):
with QMutexLocker(self.mutex):
self.stoped = True
def isStoped(self):
with QMutexLocker(sellf.mutex):
return self.stoped
if __name__ == "__main__" :
app = QApplication(sys.argv)
main = MainWindow()
main.show()
sys.exit(app.exec_())