How do I tell my main GUI to wait on a worker thread?
===

I have successfully outsourced an expensive routine in my PyQT4 GUI to a worker QThread to prevent the GUI from going unresponsive. However, I would like the GUI to wait until the worker thread is finished processing to continue executing its own code.

The solution that immediately comes to my mind is to have the thread emit a signal when complete (as I understand, QThreads already do this), and then look for this signal in the main window before the rest of the code is executed. Is this hacked?

I know QThread provides the wait() function described here <www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#wait>, but the usage is unclear to me. I think I want to call this on the main thread, but I'm not sure how to call that in my app...?