00001
00002
00003
00004
00005
00006
00007 #ifndef IRIS_H
00008 #define IRIS_H
00009
00010 #include <QApplication>
00011 #include <QDebug>
00012 #include <QtGui>
00013
00014 class IrisApplication : public QApplication
00015 {
00016 public:
00017 IrisApplication( int & argc, char ** argv ) : QApplication(argc, argv) {}
00018 virtual bool notify( QObject *receiver, QEvent *e );
00019 };
00020
00021 bool IrisApplication::notify( QObject *receiver, QEvent *e )
00022 {
00023 try
00024 {
00025 return QApplication::notify( receiver, e );
00026 }
00027 catch (QString str)
00028 {
00029 qDebug( str.toAscii() );
00030 QMessageBox::critical( NULL, "Error", str );
00031 return false;
00032 }
00033 catch (char * str)
00034 {
00035 qDebug( str );
00036 QMessageBox::critical( NULL, "Error", QString(str) );
00037 return false;
00038 }
00039 catch (const std::exception& ex)
00040 {
00041 qDebug( ex.what() );
00042 QMessageBox::critical( NULL, "Error", QString(ex.what()) );
00043 return false;
00044 }
00045 catch (const std::string& ex)
00046 {
00047 qDebug( ex.c_str() );
00048 QMessageBox::critical( NULL, "Error", QString(ex.c_str()) );
00049 return false;
00050 }
00051 catch (...)
00052 {
00053 QMessageBox::critical( NULL, "Error", QString("Unknown error.") );
00054 return false;
00055 }
00056 }
00057
00058 #endif