diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-07-27 19:52:24 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-05 16:15:33 +0000 |
commit | 14a2bd7adb03b38da05cd66571d031c99be631fb (patch) | |
tree | ec27b6e94a9a492ce134e22fac461792fbb71ba1 /src/concurrent | |
parent | ee09dbe13d761326c354dbeb42ed0bfb2e4dae17 (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.
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>
Diffstat (limited to 'src/concurrent')
-rw-r--r-- | src/concurrent/qtconcurrentrun.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp index 9a7fe2167a..7e5f10424d 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] */ |