Mac OS X (Cocoa) NSSetUncaughtExceptionHandler
Windows SetUnhandledExceptionFilter
Is there a platform independent way to do this using Qt?
Mac OS X (Cocoa) NSSetUncaughtExceptionHandler
Windows SetUnhandledExceptionFilter
Is there a platform independent way to do this using Qt?
What about obvious handler in main()? I mean your application have following lines:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow mainWin;
mainWin.show();
return a.exec();
}
What about simple wrap it with:
try{
QApplication a(argc, argv);
...
}
catch //catches any previously unhandled
{
//do graceful exit
}
Would it really be so bad to have to write #ifdefs around this? It's just a single instance and you'll never have to look at it again once you finish it. That being said at least on Windows, I'd encourage you to not do this, and instead register for Vista+'s Restart Manager if it's available.