Would appreciate someone's help with this newbie question.

With Qt 4.7, 4.8 and 5.0, my console application hangs when I run it. I'm expecting it to run to completion.

Qt Code:
  1. // from app.h
  2. class App : public QObject
  3. {
  4. Q_OBJECT
  5. public:
  6. explicit App(QCoreApplication *app, QObject *parent = 0);
  7.  
  8. void exec()
  9. {
  10. emit finished();
  11. }
  12.  
  13. signals:
  14. void finished();
  15.  
  16. public slots:
  17.  
  18. };
  19.  
  20. // from app.cpp
  21. App::App(QCoreApplication *app, QObject *parent) :
  22. QObject(parent)
  23. {
  24. connect(this, SIGNAL(finished()), app, SLOT(quit()));
  25. }
  26.  
  27. // from main.cpp
  28. int main(int argc, char *argv[])
  29. {
  30. QCoreApplication a(argc, argv);
  31.  
  32. App app(&a);
  33. app.exec();
  34.  
  35. return a.exec();
  36. }
To copy to clipboard, switch view to plain text mode 

Why doesn't this app just immediately terminate and return control to the command line?