我是 Python 中 GUI 应用程序开发的新手。我正在使用 PySide 开发 GUI。我需要跨两个线程传递参数的帮助。我知道如何使用自定义信号和插槽机制。
我希望将 alist
从 my传输second thread
到 my main thread
。
Python 伪代码(我希望将列表correction_values
从 mysecond thread
发送到main thread
):
---main thread----
self.connect(self.Tests_Start, SIGNAL("Test1_Passed()"), self.StartThread_Test1_Passed, Qt.DirectConnection)
def StartThread_Test1_Passed(self, values):
for value in values:
self.textEdit1.insertPlainText(value)
self.textEdit1.insertPlainText(',')
-
---second thread----
def Tests()
self.emit(SIGNAL("Test1_Passed()"), correction_values) # Is this way possible?