Throwing exceptions from the event handler is not supported in Qt. You must override QApplication :: notify () and catch all the exceptions there.
Overwrite the bool function QApplication :: notify (QObject * receiver, QEvent * event) so that it catches all the thrown exceptions.
You can implement this.
virtual bool notify(QObject * receiver, QEvent * event) { try { return QApplication::notify(receiver, event); } catch(std::exception& e) { qDebug() << "Exception thrown:" << e.what(); } }
source share