Hello!

I would like to declare two local QDialogs by pointers and show them at the same time, and only after the last of them is closed the reading of the code would proceed:

Qt Code:
  1. QDialog *dia1 = new QDialog(this);
  2. dia1->configure...
  3.  
  4. QDialog *dia2 = new QDialog(this);
  5. dia2->configure...
  6.  
  7. dia1->show();
  8. dia2->show();
  9.  
  10. //The reading of the code stops here while the user uses the two dialogs as it pleases him, and after closing the last of the two the reading of the code proceeds
  11.  
  12. delete dia1;
  13. delete dia2;
To copy to clipboard, switch view to plain text mode 

The problem is that I simple don't know how to this without causing some sort of bad consequence. If I try to use exec() for both of them, the second Dialog is opened only after closing the first. If I use show() for both, than the rest of the code will be read even with the dialogs still opened. If I set show() for the first and exec() for the second, than it's impossible to touch in the first QDialog; it will be blocked while I work with the second dialog. setWindowModality() doesn't seems to add any improvement to this situation.

Is there a possible way of doing this?


Thanks,

Momergil