-1
저는 Python의 GUI 응용 프로그램 개발을 처음 접했습니다. PySide를 사용하여 GUI를 개발하고 있습니다. 두 스레드간에 매개 변수를 전달하는 데 도움이 필요합니다. 맞춤 신호 및 슬롯 메커니즘을 사용하는 방법을 알고 있습니다.PySide : 목록을 매개 변수로 사용하는 emit() 신호
을 내 second thread
에서 내 main thread
으로 전송하고 싶습니다.
파이썬 의사 코드 (나는 main thread
내 second 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(',')
-
---second thread----
def Tests()
self.emit(SIGNAL("Test1_Passed()"), correction_values) # Is this way possible?
[PySide의 신호와 슬롯] (https://qt-project.org/wiki/Signals_and_Slots_in_PySide)도 흥미로울 것입니다. – Trilarion
[PySide의 스레드 간 통신] 가능한 복제본 (http://stackoverflow.com/questions/2823112/communication-between-threads-in-pyside) – ekhumoro