hello! I'm writing the following application:

main.cpp:

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "mainwindow.h"
  3. #include <QInputDialog>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8.  
  9. MainWindow w;
  10.  
  11. bool ans1, ans2;
  12. int i1 = id.getInt(&w, w.tr("Title"), w.tr("Text"),0,0,20,1,&ans1));
  13. int i2 = id.getInt(&w, w.tr("Title"), w.tr("Text"),0,0,20,1,&ans2));
  14.  
  15. if (ans1 && ans2)
  16. {
  17. w.showMaximized();
  18. }
  19. else
  20. {
  21. w.close();
  22. }
  23.  
  24. return a.exec();
  25.  
  26. }
To copy to clipboard, switch view to plain text mode 

If I chose "OK" for both the first input dialog and the second one then the program continues rightly and clicking the classic "X" it exits correctly.
While if I chose "Cancel" in one of the input dialogs the window doesn't show (and I want it) but the application doesn't quit at all. It remains running in RAM.
I found this behaviour by debugging the program putting a breakpoint at the row "return a.exec();". This instruction never stop (so the program loops in the exec() function). what can it be?

thanks