Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
src_corelib_thread_qfuturesynchronizer.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
6{
7 QFutureSynchronizer<void> synchronizer;
8
9 ...
10
11 synchronizer.addFuture(QtConcurrent::run(anotherFunction));
12 synchronizer.addFuture(QtConcurrent::map(list, mapFunction));
13
14 return; // QFutureSynchronizer waits for all futures to finish
15}
void addFuture(QFuture< T > future)
QFuture< void > map(QThreadPool *pool, Sequence &&sequence, MapFunctor &&map)
Calls function once for each item in sequence.
auto run(QThreadPool *pool, Function &&f, Args &&...args)
QList< int > list
[14]