Hi,
I've read about threads and signals in some other topics but I couldn't really find something similar to this.
I have a worker thread that is supposed to ping the GUI with information every now and then. The algorithm is similar to:
Qt Code:
while(hasWork()) { emit Status() DoWork() emit Status() }To copy to clipboard, switch view to plain text mode
The problem is that the slots connected to Status are only executed after all the work is done and the while loop has exited.
Considering that:
- I'm calling exec() in QThread::run()
- I'm using queued connections
- I'm starting the work by emitting a signal. The signal is connected to the slot of an object that lives in the thread and the slot is executed in the thread.
- the slot and its parent object live in the GUI thread.
... I think that the thread's event loop is blocked while executing the slot that started the thread and can't process my emitted signals.
Any ideas on getting around this issue?
Bookmarks