Instead of setting a flag, have the slot emit a master "completed" signal when all of the threads have finished. Connect this signal to some other slot that then processes the composite results of the threads. No polling is needed.
Of course, you have protected your main thread slot with a mutex or some similar mechanism to ensure that two threads don't attempt to update the status at the same time, right?
--- Edit
This last point (on a mutex) may not actually be a requirement. You should probably consult the Qt docs on threading and on signals and slots. In particular, connections between signals and slots across threads should be made as Queued Connections. In that case the slot will be thread safe, since signals will be queued for handling as they are received.
Bookmarks