23QFutureIterator<QString>
i(
future);
25while (
i.hasPrevious())
30using NetworkReply = std::variant<QByteArray, QNetworkReply::NetworkError>;
33using IOResult = std::variant<QString, IOError>;
41 if (
auto error = std::get_if<QNetworkReply::NetworkError>(&
reply))
44 auto data = std::get_if<QByteArray>(&
reply);
50if (
auto filePath = std::get_if<QString>(&
result)) {
71auto continuation =
future.then([](
int res1){ ... }).then([](
int res2){ ... })...
75 auto result = continuation.result();
83auto resultFuture =
future.then([](
int res) {
87}).onFailed([](
const Error &
e) {
97auto result = resultFuture.result();
104 throw std::runtime_error(
"message");
106}).onFailed([](
const std::exception &
e) {
108}).onFailed([](
const std::runtime_error &
e) {
115auto resultFuture =
future.then([](
int res) {
117 throw Error(
"message");
119}).onFailed([](
const std::exception &
e) {
126 auto result = resultFuture.result();
139 void singleArgSignal(
int value);
140 void multipleArgs(
int value1,
double value2,
const QString &value3);
149using Args = std::tuple<int, double, QString>;
168 throw std::exception();
170}).onFailed([](
const std::exception &
e) {
179auto resultFuture = testFuture.
then([](
int res) {
196auto resultFuture = testFuture.
then([](
int res) {
234 throw std::exception();
235}).onFailed(
this, [] {
253auto resultFuture = testFuture.
then([](
int res) {
276 QtFuture::whenAll<std::vector<QFuture<int>>>(inputFutures.begin(), inputFutures.end());
306 QtFuture::whenAll<std::vector<FuturesVariant>>(intFuture, stringFuture, voidFuture);
364auto downloadImages = [] (
const QUrl &
url) {
404const std::vector<int>
values{1, 2, 3};
413const int count =
f.resultCount();
420const
int result = *
f.takeResult();
426const
bool started =
f.isStarted();
428const bool finished =
f.isFinished();
QFuture< ResultType< Function > > then(Function &&function)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QFuture< ResultType > mappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&map, ReduceFunctor &&reduce, ReduceOptions options=ReduceOptions(UnorderedReduce|SequentialReduce))
auto run(QThreadPool *pool, Function &&f, Args &&...args)
QFuture< OutputSequence > whenAll(InputIt first, InputIt last)
Q_CORE_EXPORT QFuture< void > makeReadyVoidFuture()
static QFuture< std::decay_t< T > > makeReadyValueFuture(T &&value)
static QFuture< ContainedType< Container > > makeReadyRangeFuture(Container &&container)
static QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QFuture< WhenAnyResult< typename QtPrivate::Future< ValueType >::type > > whenAny(InputIt first, InputIt last)
DBusConnection const char DBusError * error
static Q_CONSTINIT QBasicAtomicInt running
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
void uint64_t uint64_t uint64_t value2
GLenum GLsizei GLsizei GLint * values
[15]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLenum GLenum GLenum scale
#define qPrintable(string)
QList< QImage > images
[6]
QUrl url("example.com")
[constructor-url-reference]
std::variant< QString, IOError > IOResult
std::variant< QByteArray, QNetworkReply::NetworkError > NetworkReply
[2]
QFuture< QString > future
[0]
QFuture< QString >::const_iterator i