From daade9b90dd39aa844cb683af776b802b0786ba7 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 16 Jun 2016 11:56:42 +0200 Subject: QEventLoop: better describe the exception safety of Qt 1) In general it's unsafe to let exceptions propagate through Qt code, so document that. 2) Add a note that overriding notify() makes sense only in Qt 5, in Qt 6 it's going away. 3) The advice applies also to applications not using QApplication, but just QCoreApplication. Change-Id: I4f6e74c53da757faf2eeaa9de226ceba55c52536 Reviewed-by: Thiago Macieira Reviewed-by: Martin Smith --- src/corelib/kernel/qeventloop.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qeventloop.cpp') diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp index dca25ce968..0ee677d213 100644 --- a/src/corelib/kernel/qeventloop.cpp +++ b/src/corelib/kernel/qeventloop.cpp @@ -182,8 +182,10 @@ int QEventLoop::exec(ProcessEventsFlags flags) { if (exceptionCaught) { qWarning("Qt has caught an exception thrown from an event handler. Throwing\n" - "exceptions from an event handler is not supported in Qt. You must\n" - "reimplement QApplication::notify() and catch all exceptions there.\n"); + "exceptions from an event handler is not supported in Qt.\n" + "You must not let any exception whatsoever propagate through Qt code.\n" + "If that is not possible, in Qt 5 you must at least reimplement\n" + "QCoreApplication::notify() and catch all exceptions there.\n"); } locker.relock(); QEventLoop *eventLoop = d->threadData->eventLoops.pop(); -- cgit v1.2.3