ecce
14th May 2016, 10:45
How do you wait for a qthread to finish without blocking the main loop (thereby blocking the responsiveness of the main window)? I'm using PyQt5.
# When scan button is pressed
def scan(self, e):
for dev in self.deviceList:
thread = TestThread(self, dev)
thread.debugOutput.connect(self.updateTextEdit)
thread.start()
print("Thread finished")
The thread(s) started in this piece of code do GUI updates to inform the user of what's going on. I do not want to block that. I want the "thread finished" to be printed out once the thread actually is finished.
# When scan button is pressed
def scan(self, e):
for dev in self.deviceList:
thread = TestThread(self, dev)
thread.debugOutput.connect(self.updateTextEdit)
thread.start()
print("Thread finished")
The thread(s) started in this piece of code do GUI updates to inform the user of what's going on. I do not want to block that. I want the "thread finished" to be printed out once the thread actually is finished.