summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <[email protected]>2023-07-27 19:52:24 +0200
committerMarc Mutz <[email protected]>2023-08-04 19:49:32 +0200
commit47a0282707d6a0d12f6f584c81a982632d09cfb7 (patch)
tree6e8f74612e60c9503fc9ec6dd37f099e77b4cb50
parentedcb8e901b9353eacaefc5ba646800125edafb51 (diff)
[docs] Link from QtConcurent::run() to QThreadPool::start(Callable&&)
The latter is a better choice if you don't need the result QFuture. Describe the QThreadPool::start() overload in prose, since the signature changed in 6.6 from std::function<void()> to Callable auto&&. The chosen wording is compatible with both. Pick-to: 6.6 6.5 6.2 5.15 Fixes: QTBUG-111875 Change-Id: I9f67c2f7e4b221602bf1c35b72e5d38898a4f0c9 Reviewed-by: Leena Miettinen <[email protected]> Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
-rw-r--r--src/concurrent/qtconcurrentrun.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp
index 9a7fe2167a9..7e5f10424db 100644
--- a/src/concurrent/qtconcurrentrun.cpp
+++ b/src/concurrent/qtconcurrentrun.cpp
@@ -80,6 +80,10 @@
\snippet code/src_concurrent_qtconcurrentrun.cpp 2
+ If you don't need the result (for example, because the function returns
+ \c{void}), using the QThreadPool::start() overload taking a function object
+ is more efficient.
+
As documented above, passing arguments is done like this:
\snippet code/src_concurrent_qtconcurrentrun.cpp 3
@@ -251,7 +255,7 @@
running task, fetching multiple results from the called \a function or
monitoring progress reported by the \a function.
- \sa {Concurrent Run (basic mode)}, {Concurrent Run With Promise}
+ \sa {Concurrent Run (basic mode)}, {Concurrent Run With Promise}, QThreadPool::start()
//! [run-description]
*/