Just set the QProgressDialog as the parent of the new dialog which is being showed up.

A small example
Qt Code:
  1. int main(int argc, char * argv[])
  2. {
  3. QApplication app(argc, argv);
  4.  
  5.  
  6. int value = 100;
  7. dialog.setMaximum(value);
  8. dialog.show();
  9.  
  10. for(int i = 0; i <= value; i++)
  11. {
  12. app.thread()->msleep(1000);
  13. dialog.setValue(i);
  14. app.processEvents();
  15.  
  16. if((i%10) == 0)
  17. {
  18. QMessageBox::information(&dialog, "Message", "Click OK to Continue");
  19. }
  20. }
  21.  
  22. return 0;
  23. }
To copy to clipboard, switch view to plain text mode