try { // `count()` throws exception connect(thread, SIGNAL(started()), engine, SLOT(count())); } catch(const X& e) {}
As of Qt-5, I get follow
You can try this for an example, to see that your solution is good:
int f() { throw 1; return 5; } void g(int x) { cout << x << endl; } int main() { try { g(f()); }catch(int) { cout << "Caught exception" << endl; } }