diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-10-29 10:11:10 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-10-29 20:18:47 +0100 |
commit | e53a3bd85afb0e140aa4b89925345c33dc464bf5 (patch) | |
tree | 39f2e0e9e8a125f27fa85ff0d8d1c840a5edfe7a /src/concurrent | |
parent | 0526ae3f03a41ea19cfdf5ff3ca8f603d4f3e1a5 (diff) |
Move porting guide for QtConcurrent to its designated page
Also move the porting section for QFuture and related classes after the
section for view classes, to make the order more natural for reading.
Change-Id: I5ea816d7bb3dfdda2b74112418bf07954c9ec94c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/concurrent')
-rw-r--r-- | src/concurrent/doc/src/qt6-changes.qdoc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/concurrent/doc/src/qt6-changes.qdoc b/src/concurrent/doc/src/qt6-changes.qdoc index 4f0d1855d0..e276736538 100644 --- a/src/concurrent/doc/src/qt6-changes.qdoc +++ b/src/concurrent/doc/src/qt6-changes.qdoc @@ -41,6 +41,36 @@ In this topic we summarize those changes in Qt Concurrent, and provide guidance to handle them. - \section1 ADD STUFF HERE + \section1 QtConcurrent::run() + QtConcurrent::run() has been improved to work with a variable number + of arguments, so the signatures are changed to: + + \code + // run + template <typename T> + QFuture<T> run(Function &&f, Args &&...args) + + // run with a QThreadPool argument + template <typename T> + QFuture<T> run(QThreadPool *pool, Function &&f, Args &&...args) + \endcode + + As a side effect, if \c f is a pointer to a member function, the first + argument of \c args should be the object for which that member is defined + (or a reference, or a pointer to it). So instead of writing: + + \code + QImage image = ...; + QFuture<void> future = QtConcurrent::run(&image, &QImage::invertPixels, QImage::InvertRgba); + \endcode + + You have to write: + + \code + QFuture<void> future = QtConcurrent::run(&QImage::invertPixels, &image, QImage::InvertRgba); + \endcode + + Other methods of QtConcurrent have no behavioral changes and do not introduce + source compatibility breaks. */ |