我是Python中GUI应用程序开发的新手。我正在使用PySide开发一个GUI。我需要两个线程之间传递参数的帮助。我知道如何使用自定义信号和插槽机制。在
我想把list
从我的second thread
传送到我的main thread
。在
Python伪代码(我希望从我的second thread
向main thread
发送一个列表correction_values
):
---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(',')
-
^{pr2}$
可以使用新样式的发射和信号。这比旧式容易。你刚刚创造的信号对象
接下来,使用'connect'连接信号
^{pr2}$检查你的函数是传递变量
最后,使用“发射”信号
您也可以阅读此document了解更多信息。在
相关问题 更多 >
编程相关推荐