I have written this example code to try and figure out how to communicate between a background thread, and the main thread. As I understand it, a thread cannot simply interact w
You can define a custom signal, which can be safely emitted across threads:
from PySide.QtCore import Signal
class Gui(QWidget):
def initUI(self):
...
bgThread.dataReceived.connect(lambda data: lbl2.setText(str(data)))
class BackgroundThread(QThread):
dataReceived = Signal(list)
...
def _summary(self):
...
self.dataReceived.emit(data)