http://bugzilla.lyx.org/show_bug.cgi?id=3288
This is recommended by 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.
* GuiApplication::notify(): reimplemented from QApplication::notify().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17688
a592a061-630c-0410-9148-
cb99ea01b6c8
#include "Color.h"
#include "debug.h"
#include "funcrequest.h"
+#include "gettext.h"
#include "lyx_main.h"
#include "lyxfunc.h"
#include "lyxrc.h"
}
+bool GuiApplication::notify(QObject * receiver, QEvent * event)
+{
+ bool return_value;
+ try {
+ return_value = QApplication::notify(receiver, event);
+ }
+ catch (...) {
+ lyxerr << to_utf8(_("ERROR: Exception caught in the Qt event loop, exiting..."))
+ << endl;
+
+ LyX::cref().emergencyCleanup();
+ abort();
+ }
+
+ return return_value;
+}
+
+
void GuiApplication::syncEvents()
{
// This is the ONLY place where processEvents may be called.
void unregisterSocketCallback(int fd);
//@}
+ /// Methods inherited from \c Application class
+ //@{
+ virtual bool notify(QObject * receiver, QEvent * event);
+ //@}
+
///
ColorCache & colorCache() { return color_cache_; }
///