diff options
| author | Alexei Cazacov <alexei.cazacov@qt.io> | 2025-09-03 15:50:47 +0300 |
|---|---|---|
| committer | Alexei Cazacov <alexei.cazacov@qt.io> | 2025-09-09 15:35:39 +0300 |
| commit | eba48b0c21d467237aee347a5906b5b2623e777d (patch) | |
| tree | e924c73bca8c9c54fb65f7d424022f642c9bcee9 /src/concurrent/qtconcurrentmap.cpp | |
| parent | e6ddf72279a36c25a83ea057698345e15e18c04c (diff) | |
Doc: Document the specific headers for the Qt Concurrent module
This commit makes the Image Scaling example use the optimized header
and updates documentation to include optimized header inclusion for
QtConcurrent functions.
Fixes: QTBUG-114663
Pick-to: 6.10 6.9 6.8
Change-Id: I50e4137ea3bc22bf88a3c9e4856043ba3d02f06e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/concurrent/qtconcurrentmap.cpp')
| -rw-r--r-- | src/concurrent/qtconcurrentmap.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp index 4af0258240a..2cf45367546 100644 --- a/src/concurrent/qtconcurrentmap.cpp +++ b/src/concurrent/qtconcurrentmap.cpp @@ -13,6 +13,38 @@ See the \l {Qt Concurrent} module documentation for an overview of available functions, or see below for detailed information on each function. + \section1 Optimize includes + + If you include the \c <QtConcurrent> header, the entire Qt Concurrent + module with the entire Qt Core module will be included, which may increase + compilation times and binary sizes. To use individual functions from the + QtConcurrent namespace, you can include more specific headers. + + The table below lists the functions in the QtConcurrent namespace and + their corresponding headers: + + \table + \header + \li Function + \li Header + \row + \li \l {QtConcurrent::run}{QtConcurrent::run()} + \li \c <QtConcurrentRun> + \row + \li \l {QtConcurrent::task}{QtConcurrent::task()} + \li \c <QtConcurrentTask> + \row + \li \l {QtConcurrent::filter}{QtConcurrent::filter()}, + \l {QtConcurrent::filtered}{QtConcurrent::filtered()}, + \l {QtConcurrent::filteredReduced}{QtConcurrent::filteredReduced()} + \li \c <QtConcurrentFilter> + \row + \li \l {QtConcurrent::map}{QtConcurrent::map()}, + \l {QtConcurrent::mapped}{QtConcurrent::mapped()}, + \l {QtConcurrent::mappedReduced}{QtConcurrent::mappedReduced()} + \li \c <QtConcurrentMap> + \endtable + \inheaderfile QtConcurrent \ingroup thread */ @@ -130,6 +162,20 @@ Note that the result types above are not QFuture objects, but real result types (in this case, QList<QImage> and QImage). + \section1 Optimize includes + + If you include the \c <QtConcurrent> header, the entire Qt Concurrent + module with the entire Qt Core module will be included, which may increase + compilation times and binary sizes. To use the + \l {QtConcurrent::map}{QtConcurrent::map()}, + \l {QtConcurrent::mapped}{QtConcurrent::mapped()}, and + \l {QtConcurrent::mappedReduced}{QtConcurrent::mappedReduced()} functions, + you can include a more specific header: + + \code + #include <QtConcurrentMap> + \endcode + \section1 Concurrent Map QtConcurrent::mapped() takes an input sequence and a map function. This map |
