Doc: Clarify run() and started() order in QThread

This fix addresses a customer suggestion to clarify the QThread()
documentation. It now states that started() is emitted by the newly
started thread, so any slots connected to it will occur by queued
invocation. For clarity purposes, an additional sentence has been
added to state that whilst the event may have been posted before
run() is called, cross-thread delivery of the signal may still
be pending. A link to 'Signals and Slots Across Threads' has also
been added.

Fixes: QTBUG-112221
Pick-to: 6.7 6.5
Change-Id: Id502eb4bf48b745af4d9906d7cd05de73d2b6418
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 371872af23c1c9f9b3b56dd191fb13f850615dd4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Safiyyah Moosa 2024-10-21 23:33:52 +02:00 committed by Qt Cherry-pick Bot
parent e2e20c19f6
commit 50f507eb44

View File

@ -371,9 +371,12 @@ QThreadPrivate::~QThreadPrivate()
\fn void QThread::started()
This signal is emitted from the associated thread when it starts executing,
before the run() function is called.
so any slots connected to it may be called via queued invocation. Whilst
the event may have been posted before run() is called, any
\l {Signals and Slots Across Threads} {cross-thread delivery} of the signal
may still be pending.
\sa finished()
\sa run(), finished()
*/
/*!