Intercept event calls and log them on exceptions. From the official docs https://doc.qt.io/qt-5/qcoreapplication.html#notify: "Future direction: This function will not be called for objects that live outside the main thread in Qt 6. Applications that need that functionality should find other solutions for their event inspection needs in the meantime. The change may be extended to the main thread,
| 48 | // around. There are multiple suggestions for other solutions in the |
| 49 | // provided link. |
| 50 | virtual bool notify( QObject* receiver, QEvent* event ) override |
| 51 | { |
| 52 | try |
| 53 | { |
| 54 | return QApplication::notify( receiver, event ); |
| 55 | } |
| 56 | catch ( std::exception& e ) |
| 57 | { |
| 58 | LOG( ERROR ) << "Exception thrown from an event handler: " |
| 59 | << e.what(); |
| 60 | } |
| 61 | return false; |
| 62 | } |
| 63 | }; |
| 64 | |
| 65 | void mainQtMessageHandler( QtMsgType type, |