Fake,
The QThread class provides several signals that help provide the status of the thread; started() and finished(). You could monitor the status of your thread by connecting these signals to a local slot that would maintain some sort of variable in tracking the status that could be used to trap in the closeEvent() of your mainwindow.
psuedo:
bool ftpActive;
connect( ftpThread, SIGNAL( started() ), mainwindow, SLOT( ftpStarted() ));
connect( ftpThread, SIGNAL( finished() ), mainwindow, SLOT (ftpFinished() ));
void MainWindow::ftpStarted(){ ftpActive = true; }
void MainWindow::ftpFinished(){ ftpActive = false; }
In the closeEvent you could trap for the ftpActive flag;
void MainWindow::closeEvent()
{
while( ftpActive ){ // do something: sleep or maybe show progress dialog in pulsate state while waiting for process to finish // };
}
Just a thought...