Qt doc says:
void QDialog::done ( int r ) [virtual slot]

Closes the dialog and sets its result code to r. If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return r.
myDialog.exec();

inside myDialog slots..

{
///////
done(1);//here the Dialog invisible
QProgressDialog dia;
////dialog related parameters
foreach(---){
//update progress ba
qApp->processEvents();
//////
}

}
what is the behavior of processEvents() after done() and before done() with above QProgressbar?how events are handled in both the cases?