Waiting for QThreads to finish

I have a data model for a Qt GUI I am writing. There can be multiple async update to the model and the async task completion time may not mimic the order of starting time. I want to update GUI, only when all running async tasks have finished. (The async tasks are QThreads).

No, I want the application to be responsive, the async operation does not block the GUI, and there might be multiple async operations doing different tasks. But, once they have all finished, I want to update something in the GUI i.e. execute a function from GUI thread i.e.

No, I want the application to be responsive, the async operation does not block the GUI, and there might be multiple async operations doing different tasks. But, once they have all finished, I want to update something in the GUI i.e. execute a function from GUI thread i.e.

You dont need a finished SIGNAL. You need to understand your gui that something happened.

When you override run like you are, you are blocking the thread's event loop. You could do the same by having your worker object run in a 25ms timer. Connect the worker object to the thread as suggested in the article. Have the run entry point of the object start the timer and just emit your loaded signal as designed.

This is truly the best way to run threads. You can then request termination and they will stop. For example: