I know this is obviously not a new question but so far I have not been able to get it to work. So here is my code. It compiles but when I run it and execute a throw() within my MainWindow class, the throw() seems to get caught by the reimplemented notify, but the notify method seems to keep getting called over and over again until I eventually get a SIGABRT. What am I doing wrong?

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "mainwindow.h"
  3.  
  4. class App : public QApplication
  5. {
  6. public:
  7.  
  8. App(int& argc, char** argv):QApplication(argc,argv){}
  9. virtual ~App(){}
  10.  
  11. virtual bool notify(QObject *receiver, QEvent *event)
  12. {
  13. try
  14. {
  15. return QApplication::notify(receiver, event);
  16. }
  17. catch(std::exception& e)
  18. {
  19. QMessageBox::information(0,"","Exception thrown",QMessageBox::Ok);
  20. }
  21. return false;
  22. }
  23. };
  24.  
  25. int main(int argc, char *argv[])
  26. {
  27. App a(argc, argv);
  28. MainWindow w;
  29.  
  30. w.show();
  31. return a.exec();
  32. }
To copy to clipboard, switch view to plain text mode