remove QTimer

This commit is contained in:
Irony 2019-01-05 21:36:08 +08:00
parent 73d1122bf2
commit a094e5ca50

View file

@ -9,7 +9,7 @@ Created on 2018年3月9日
@file: moveToThread
@description: moveToThread
"""
from PyQt5.QtCore import QObject, pyqtSignal, QThread, QTimer
from PyQt5.QtCore import QObject, pyqtSignal, QThread
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QProgressBar, QPushButton
@ -52,8 +52,8 @@ class Window(QWidget):
def onStart(self):
print('main id', int(QThread.currentThreadId()))
self._thread.started.connect(self._worker.run)
self._thread.start() # 启动线程
QTimer.singleShot(1, self._worker.run)
def closeEvent(self, event):
if self._thread.isRunning():