try
{ // `count()` throws exception
connect(thread, SIGNAL(started()), engine, SLOT(count()));
}
catch(const X& e)
{}
As of Qt-5, I get follow
If someone needs an example code to override QApplication::notify, I got one from here (in Japanese): http://www.02.246.ne.jp/~torutk/cxx/qt/QtMemo.html
#include "MyApplication.h"
#include
MyApplication::MyApplication(int& argc, char** argv) :
QApplication(argc, argv) {}
bool MyApplication::notify(QObject* receiver, QEvent* event) {
bool done = true;
try {
done = QApplication::notify(receiver, event);
} catch (const std::exception& ex) {
// ログや何らかの回復処理
} catch (...) {
// ログや何らかの回復処理
}
return done;
}