QThread signals documentation improvement
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 10 Oct 2012 15:28:42 +0000 (17:28 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 15 Oct 2012 08:18:31 +0000 (10:18 +0200)
Be more explicit on from which thread the signals are emitted, and
mention that it is possible to connect finished with deleteLater

Change-Id: Ib72be94a81be383774f08d71915fa609843030e0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
src/corelib/thread/qthread.cpp

index 5949f9a..72bae48 100644 (file)
@@ -323,7 +323,8 @@ QThreadPrivate::~QThreadPrivate()
 /*!
     \fn void QThread::started()
 
-    This signal is emitted when the thread starts executing.
+    This signal is emitted from the associated thread when it starts executing,
+    before the run() function is called.
 
     \sa finished(), terminated()
 */
@@ -331,7 +332,14 @@ QThreadPrivate::~QThreadPrivate()
 /*!
     \fn void QThread::finished()
 
-    This signal is emitted when the thread has finished executing.
+    This signal is emitted from the associated thread right before it finishes executing.
+
+    When this signal is emitted, the event loop has already stopped running.
+    No more events will be processed in the thread, except for deferred deletion events.
+    This signal can be connected to QObject::deleteLater(), to free objects in that thread.
+
+    \note If the associated thread was terminated using terminate(), it is undefined from
+    which thread this signal is emitted.
 
     \sa started(), terminated()
 */
@@ -341,6 +349,8 @@ QThreadPrivate::~QThreadPrivate()
 
     This signal is emitted when the thread is terminated.
 
+    It is undefined from which thread this signal is emitted.
+
     \sa started(), finished()
 */