MCPcopy Create free account
hub / github.com/PyQt5/PyQt / run

Method run

QMetaObject/CallInThread.py:56–67  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

54 self._running = False
55
56 def run(self):
57 while self._running:
58 text = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
59 # 通过`invokeMethod`队列调用对应控件信号,`self._parent`是Window窗口对象
60 QMetaObject.invokeMethod(self._parent, 'appendText',
61 Qt.QueuedConnection,
62 Q_ARG(str, text + ' from Signal'))
63 # 通过`invokeMethod`队列调用对应控件槽函数`append`
64 QMetaObject.invokeMethod(self._textBrowser, 'append',
65 Qt.QueuedConnection,
66 Q_ARG(str, text + ' to Slot'))
67 time.sleep(1)
68
69
70class Window(QWidget):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected