PDA

View Full Version : howto Processing GUI events until a thread exits



doggrant
5th October 2009, 16:50
Hi,

I have a class which inherits QThread, and calls start() from within itself to start the thread.

When I destroy the class, I wait for the thread to exit as follows :-

do
{
qApp->processEvents();

}while ( isRunning() );

This can sometimes cause the system to go to 100% (ish) CPU. Is there a better way to do this? - ie wait for the thread to finish, and process any events while doing so.

cheers,

David