Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.1
-
None
-
QT 4.7.0, 4.7.1, debug & release
-
-
08cc9b9991ae9ab51bed5b857b6257401401ff6f
Description
I can not catch top level exceptions in Mac OsX. There are no problem in Windows.
There is my code:
class App: public QApplication{ public: ... bool notify(QObject *o, QEvent *e){ try { return QApplication::notify(o, e); } catch(...){ QMessageBox::information(0,tr("Error"),tr("Press OK to continue.")); } } } int main(int argc, char *argv[]) { App a(argc, argv); try{ MainWindow w; w.resize(900,700); w.show(); return a.exec(); }catch(..){ QMessageBox::information(0,"Critical error","Press OK to close program"); } }
I send throw an exception in MainWindow.
I see "Error" message with continue on Windows platform, but on Mac OsX I see only Critical Error without continue.
On MacOs in debug output I see the message from QT:
"Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there."
But I already do it.