Quote Originally Posted by svenni
Think of a situation like this:
[...]
Now I decide to have methodA to do its work in a thread, because methodA works slower than expected, and the gui should stay responsive while methodA is at work. But I must be careful, because methods B and C have to wait for methodA to finish.

One possibility would be to react on the finished() signal as proposed, but why should methodB know that methodA does its homework in a thread? It should not be of any interest for methodB how methodA does it's work.
Well,I confess I haven't well understood what you want to say in the last paragraph but if you use the SIGNAL/SLOT method to start methodB after the end of the thread that computes methodA..well methodB is not aware of the fact that mA is running in a thread:mB runs in the principal thread and it starts as the thread emits the finished signal.
Quote Originally Posted by svenni
Another possibility would be to create a thread that executes both methodA+B, but what if methodB accesses the gui? It can't be run in a thread other than the gui thread.
You can make you thread communicate with the GUI thread using signals.

Quote Originally Posted by svenni
In that situation, all I want to do in methodA is

methodA
{
-) startThread, that computes the maximum prime (whatever)
-) wait for this thread to finish, but stay responsive for gui events (e.g. move the window)
-) exit methodA
}
This is exactly what you can achieve using slot connection.

You are welcome.