【发布时间】:2014-09-15 17:04:00
【问题描述】:
我是 Python 中 GUI 应用程序开发的新手。我正在使用 PySide 开发 GUI。我需要跨两个线程传递参数的帮助。我知道如何使用自定义 Signals 和 Slot 机制。
我希望将list 从我的second thread 传输到我的main thread。
Python 伪代码(我希望将列表correction_values 从我的second 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?
【问题讨论】:
标签: python python-2.7 signals pyside emit