summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2016-06-16 11:56:42 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2016-07-02 19:36:10 +0000
commitdaade9b90dd39aa844cb683af776b802b0786ba7 (patch)
treec4b8b3422c5b814f076eba2e3c1516bc2baa0eca /src/corelib/kernel
parent3b5db8f3a6663fd65d74da875a6d22c430c2e4f7 (diff)
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 <thiago.macieira@intel.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qeventloop.cpp6
1 files changed, 4 insertions, 2 deletions
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();