From 14a2bd7adb03b38da05cd66571d031c99be631fb Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 27 Jul 2023 19:52:24 +0200 Subject: [PATCH] [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 to Callable auto&&. The chosen wording is compatible with both. Fixes: QTBUG-111875 Change-Id: I9f67c2f7e4b221602bf1c35b72e5d38898a4f0c9 Reviewed-by: Leena Miettinen Reviewed-by: Ivan Solovev Reviewed-by: Qt CI Bot (cherry picked from commit 47a0282707d6a0d12f6f584c81a982632d09cfb7) Reviewed-by: Qt Cherry-pick Bot --- src/concurrent/qtconcurrentrun.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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] */