diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2013-09-08 17:33:41 +0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-14 02:58:26 +0200 |
commit | 6780f76ee0e9122b8c15861a85fd29a908724d72 (patch) | |
tree | b51e62c577a6068384664f410f5700fa8544f0e5 /src/corelib/doc/src/threads.qdoc | |
parent | 5852ddb110e63cc9d2271431a7776978c2249877 (diff) |
Doc: Remove page about how to start QThreads
Multiple issues:
- Incomplete: It doesn't talk about instantiating a raw QThread
- Redundant: Its contents are already presented in QThread's class ref
- Incorrect: It is legal to create a QThread before a QCoreApplication
- Irrelevant: The bit about QCoreApplication::exec() and the etymology
of "GUI thread" is unrelated to the topic of starting threads
Also remove snippets that are no longer used
Change-Id: Ice1819845b5b2cf843719edaa7b0f4bbb1e8bd97
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/doc/src/threads.qdoc')
-rw-r--r-- | src/corelib/doc/src/threads.qdoc | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/src/corelib/doc/src/threads.qdoc b/src/corelib/doc/src/threads.qdoc index 79bd7a62a3..27aca86406 100644 --- a/src/corelib/doc/src/threads.qdoc +++ b/src/corelib/doc/src/threads.qdoc @@ -60,7 +60,6 @@ \li \l{Recommended Reading} \li \l{The Threading Classes} \li \l{Multithreading Technologies in Qt} - \li \l{Starting Threads with QThread} \li \l{Synchronizing Threads} \li \l{Reentrancy and Thread-Safety} \li \l{Threads and QObjects} @@ -122,7 +121,7 @@ \contentspage Thread Support in Qt \previouspage Thread Support in Qt - \nextpage Starting Threads with QThread + \nextpage Synchronizing Threads Qt offers many classes and functions for working with threads. Below are three different approaches that Qt programmers can use to implement @@ -285,60 +284,10 @@ */ /*! - \page threads-starting.html - \title Starting Threads with QThread - - \contentspage Thread Support in Qt - \previouspage Multithreading Technologies in Qt - \nextpage Synchronizing Threads - - A QThread instance represents a thread and provides the means to - \l{QThread::start()}{start()} a thread, which will then execute the - reimplementation of QThread::run(). The \c run() implementation is for a - thread what the \c main() entry point is for the application. All code - executed in a call stack that starts in the \c run() function is executed - by the new thread, and the thread finishes when the function returns. - QThread emits signals to indicate that the thread started or finished - executing. - - \section1 Creating a Thread - - To create a thread, subclass QThread and reimplement its - \l{QThread::run()}{run()} function. For example: - - \snippet threads/threads.h 0 - \codeline - \snippet threads/threads.cpp 0 - \snippet threads/threads.cpp 1 - \dots - \snippet threads/threads.cpp 2 - - \section1 Starting a Thread - - Then, create an instance of the thread object and call - QThread::start(). Note that you must create the QApplication (or - QCoreApplication) object before you can create a QThread. - - The function will return immediately and the - main thread will continue. The code that appears in the - \l{QThread::run()}{run()} reimplementation will then be executed - in a separate thread. - - Creating threads is explained in more detail in the QThread - documentation. - - Note that QCoreApplication::exec() must always be called from the - main thread (the thread that executes \c{main()}), not from a - QThread. In GUI applications, the main thread is also called the - GUI thread because it's the only thread that is allowed to - perform GUI-related operations. -*/ - -/*! \page threads-synchronizing.html \title Synchronizing Threads - \previouspage Starting Threads with QThread + \previouspage Multithreading Technologies in Qt \contentspage Thread Support in Qt \nextpage Reentrancy and Thread-Safety |