MCPcopy Index your code
hub / github.com/PyQt5/PyQt / Worker

Class Worker

QThread/SuspendThread.py:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class Worker(QThread):
22 valueChanged = pyqtSignal(int) # 值变化信号
23 handle = -1
24
25 def run(self):
26 try:
27 self.handle = ctypes.windll.kernel32.OpenThread( # @UndefinedVariable
28 win32con.PROCESS_ALL_ACCESS, False, int(QThread.currentThreadId()))
29 except Exception as e:
30 print('get thread handle failed', e)
31 print('thread id', int(QThread.currentThreadId()))
32 for i in range(1, 101):
33 print('value', i)
34 self.valueChanged.emit(i)
35 QThread.sleep(1)
36
37
38class Window(QWidget):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected