(self)
| 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 | |
| 70 | class Window(QWidget): |
nothing calls this directly
no outgoing calls
no test coverage detected