[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.

Fixes: QTBUG-111875
Change-Id: I9f67c2f7e4b221602bf1c35b72e5d38898a4f0c9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 47a0282707d6a0d12f6f584c81a982632d09cfb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-07-27 19:52:24 +02:00 committed by Qt Cherry-pick Bot
parent ee09dbe13d
commit 14a2bd7adb

View File

@ -80,6 +80,10 @@
\snippet code/src_concurrent_qtconcurrentrun.cpp 2 \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: As documented above, passing arguments is done like this:
\snippet code/src_concurrent_qtconcurrentrun.cpp 3 \snippet code/src_concurrent_qtconcurrentrun.cpp 3
@ -251,7 +255,7 @@
running task, fetching multiple results from the called \a function or running task, fetching multiple results from the called \a function or
monitoring progress reported by the \a function. 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] //! [run-description]
*/ */