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>
This commit is contained in:
Thiago Macieira 2015-04-16 17:32:18 -07:00 committed by Jani Heikkinen
parent b0a9eddf4d
commit 4fe865ac7a

View File

@ -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()
*/