diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp index 0e0f414b13..b9ff35c798 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp @@ -177,9 +177,7 @@ struct StringTransform }; QFuture fooString = - QtConcurrent::filteredReduced(strings, - StartsWith(QLatin1String("Foo")), - StringTransform()); + QtConcurrent::filteredReduced(strings, StartsWith(QLatin1String("Foo")), StringTransform()); //! [14] //! [15] @@ -196,7 +194,7 @@ QList results = future.results(); // add up all even integers QList list3 { 1, 2, 3, 4 }; -int sum = QtConcurrent::filteredReduced(list3, +QFuture sum = QtConcurrent::filteredReduced(list3, [](int x) { return (x & 1) == 0; }, @@ -213,7 +211,7 @@ void intSumReduce(int &sum, int x) } QList list { 1, 2, 3, 4 }; -int sum = QtConcurrent::filteredReduced(list, +QFuture sum = QtConcurrent::filteredReduced(list, [] (int x) { return (x & 1) == 0; }, @@ -228,7 +226,7 @@ bool keepEvenIntegers(int x) } QList list { 1, 2, 3, 4 }; -int sum = QtConcurrent::filteredReduced(list, +QFuture sum = QtConcurrent::filteredReduced(list, keepEvenIntegers, [](int &sum, int x) { sum += x; diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp index 659925a1c6..9c91715ac0 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp @@ -165,10 +165,8 @@ struct ImageTransform }; QFuture thumbNails = - QtConcurrent::mappedReduced(images, - Scaled(100), - ImageTransform(), - QtConcurrent::SequentialReduce); + QtConcurrent::mappedReduced(images, Scaled(100), ImageTransform(), + QtConcurrent::SequentialReduce); //! [11] //! [13] @@ -223,7 +221,7 @@ QList collage = QtConcurrent::mappedReduced(images, //! [16] //! [17] -QList collage = QtConcurrent::mappedReduced(images, +QList collage = QtConcurrent::mappedReduced(images, [&size](const QImage &image) { return image.scaled(size, size); }, diff --git a/src/concurrent/qtconcurrentfilter.cpp b/src/concurrent/qtconcurrentfilter.cpp index 2bec2a6eb9..663507be35 100644 --- a/src/concurrent/qtconcurrentfilter.cpp +++ b/src/concurrent/qtconcurrentfilter.cpp @@ -148,9 +148,7 @@ \snippet code/src_concurrent_qtconcurrentfilter.cpp 13 - For the reduce function, function objects are not directly - supported. Function objects can, however, be used - when the type of the reduction result is explicitly specified: + Function objects are also supported for the reduce function: \snippet code/src_concurrent_qtconcurrentfilter.cpp 14 @@ -168,9 +166,7 @@ \snippet code/src_concurrent_qtconcurrentfilter.cpp 16 - For the reduce function, lambda expressions are not directly supported. - Lambda expressions can, however, be used when the type of the reduction - result is explicitly specified: + You can also pass a lambda as a reduce object: \snippet code/src_concurrent_qtconcurrentfilter.cpp 17 diff --git a/src/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp index d68dd63bb8..8abfec4baf 100644 --- a/src/concurrent/qtconcurrentmap.cpp +++ b/src/concurrent/qtconcurrentmap.cpp @@ -274,9 +274,7 @@ \snippet code/src_concurrent_qtconcurrentmap.cpp 14 - For the reduce function, function objects are not directly - supported. Function objects can, however, be used - when the type of the reduction result is explicitly specified: + Function objects are also supported for the reduce function: \snippet code/src_concurrent_qtconcurrentmap.cpp 11 @@ -294,9 +292,7 @@ \snippet code/src_concurrent_qtconcurrentmap.cpp 16 - For the reduce function, lambda expressions are not directly supported. - Lambda expressions can, however, be used when the type of the reduction - result is explicitly specified: + You can also pass a lambda as a reduce object: \snippet code/src_concurrent_qtconcurrentmap.cpp 17