summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-04-16 17:32:18 -0700
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2015-06-22 12:04:15 +0000
commit4fe865ac7a701b7c950ee0c79b6153b43e1b49ae (patch)
treefac2e9b61bc900b7d652aca8d4339d3ebdc8b148 /src
parentb0a9eddf4da21075415c98ae4b8073043e92256e (diff)
Doc: document future direction of QCoreApplication::notify()
It will definitely not be called for events outside the main thread, but we haven't decided for the main thread, in Qt 6. [ChangeLog][Future direction notices] In Qt 6, QCoreApplication::notify() will not be called for events being delivered to objects outside the main thread. The reason for that is that the main application object may begin destruction while those threads are still delivering events, which is undefined behavior. Applications that currently override notify() and use that function outside the main thread are advised to find other solutions in the mean time. Change-Id: I27eaacb532114dd188c4ffff13d5a5c8df3bc85b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index b6f839d554..ecafe91b43 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1005,6 +1005,17 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
do not change the focus widget.
\endlist
+ \b{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, causing this function to be
+ deprecated.
+
+ \warning If you override this function, you must ensure all threads that
+ process events stop doing so before your application object begins
+ destruction. This includes threads started by other libraries that you may be
+ using, but does not apply to Qt's own threads.
+
\sa QObject::event(), installNativeEventFilter()
*/