39 bool notify ( QObject * receiver, QEvent * event )
53 return QApplication::notify(receiver,event);
55 catch (cv::Exception &exc)
57 QString name = QString(
"%1 (%2)").arg(receiver->objectName()).arg(receiver->metaObject()->className());
58 qWarning(
"Itom-Application has caught a cv::exception");
59 qWarning() << (exc.err).c_str() <<
" from" << name;
62 qFatal(
"Exiting due to exception caught. OpenCV-Exception: %s", (exc.err).c_str());
64 std::cerr <<
"Itom-Application has caught a cv::exception: " << (exc.err).c_str() <<
" from: " << name.toLatin1().constData() <<
"\n" << std::endl;
66 catch(std::exception &exc)
68 QString name = QString(
"%1 (%2)").arg(receiver->objectName()).arg(receiver->metaObject()->className());
69 qWarning(
"Itom-Application has caught a std::exception");
70 qWarning() <<
"Message:" << exc.what() <<
" from" << name;
72 qFatal(
"Exiting due to std::exception caught. Exception: %s", exc.what());
74 std::cerr <<
"Itom-Application has caught a std::exception: " << exc.what() <<
" from: " << name.toLatin1().constData() <<
"\n" << std::endl;
78 int enumIdx = QEvent::staticMetaObject.indexOfEnumerator(
"Type");
79 QMetaEnum me = QEvent::staticMetaObject.enumerator(enumIdx);
80 QByteArray key =
event ? me.valueToKeys(event->type()) : QByteArray(
"");
81 int type =
event ?
event->type() : -1;
82 QString name = QString(
"%1 (%2)").arg(receiver->objectName()).arg(receiver->metaObject()->className());
83 qWarning(
"Itom-Application has caught an unknown exception");
84 qWarning() <<
"Itom-Application caught an unknown exception from" << name <<
"from event type" << type <<
" (" << key.constData() <<
")";
86 qFatal(
"Exiting due to exception caught");
88 std::cerr <<
"Itom-Application caught an unknown exception from: " << name.toLatin1().constData() <<
" from event type " << type <<
" (" << key.constData() <<
")" <<
"\n" << std::endl;