How to signal from a running QThread back to the PyQt Gui that started it? How to signal from a running QThread back to the PyQt Gui that started it? multithreading multithreading

How to signal from a running QThread back to the PyQt Gui that started it?


The problem here is simple: your SimulRunner never gets sent a signal that causes it to start its work. One way of doing that would be to connect it to the started signal of the Thread.

Also, in python you should use the new-style way of connecting signals:

...self.simulRunner = SimulRunner()self.simulThread = QThread()self.simulRunner.moveToThread(self.simulThread)self.simulRunner.stepIncreased.connect(self.currentStep.setValue)self.stopButton.clicked.connect(self.simulRunner.stop)self.goButton.clicked.connect(self.simulThread.start)# start the execution loop with the thread:self.simulThread.started.connect(self.simulRunner.longRunning)...