Disclaimer: I'm not good with exceptions but i think you will need (to exclude the main return from the try block) something like this:
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication app(argc, argv);
  4. //...
  5. int ret_val;
  6. try {
  7. ret_val = app.exec();
  8. }
  9. catch (...){
  10. qDebug() << "Exception";
  11. }
  12. return ret_val;
  13. }
To copy to clipboard, switch view to plain text mode 
But remember that Qt doesn't throw exceptions, you will catch only yours.