void WorkingThread::run(){ forever { bool ok = doSomethingUsefulOperation(); if ( !ok ) { bool abort = false; emit abortRequested(&abort); if (abort) return; } }}void SomethingGuiClass::onAbortRequested( bool* abort ){ if ( QMessageBox::critical( this, tr("Error"), tr("Shit happened. Cancel job?") ) == QMessageBox::Ok ) *abort = true; else *abort = false;}