diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp index 0e0f414b130..e271b33b9ec 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp @@ -82,7 +82,7 @@ void addToDictionary(QSet &dictionary, const QString &string) } QStringList strings = ...; -QFuture > dictionary = QtConcurrent::filteredReduced(strings, allLowerCase, addToDictionary); +QFuture> dictionary = QtConcurrent::filteredReduced(strings, allLowerCase, addToDictionary); //! [4] @@ -93,7 +93,7 @@ QFuture lowerCaseStrings = QtConcurrent::filtered(strings.constBegin(), // filter in-place only works on non-const iterators QFuture future = QtConcurrent::filter(strings.begin(), strings.end(), allLowerCase); -QFuture > dictionary = QtConcurrent::filteredReduced(strings.constBegin(), strings.constEnd(), allLowerCase, addToDictionary); +QFuture> dictionary = QtConcurrent::filteredReduced(strings.constBegin(), strings.constEnd(), allLowerCase, addToDictionary); //! [5] @@ -121,7 +121,8 @@ QFuture grayscaleImages = QtConcurrent::filtered(images, &QImage::isGray // create a set of all printable characters QList characters = ...; -QFuture > set = QtConcurrent::filteredReduced(characters, &QChar::isPrint, &QSet::insert); +QFuture> set = QtConcurrent::filteredReduced(characters, qOverload<>(&QChar::isPrint), + qOverload(&QSet::insert)); //! [7] @@ -131,7 +132,8 @@ QFuture > set = QtConcurrent::filteredReduced(characters, &QChar::is // create a dictionary of all lower cased strings extern bool allLowerCase(const QString &string); QStringList strings = ...; -QFuture > averageWordLength = QtConcurrent::filteredReduced(strings, allLowerCase, QSet::insert); +QFuture> lowerCase = QtConcurrent::filteredReduced(strings, allLowerCase, + qOverload(&QSet::insert)); // create a collage of all gray scale images extern void addToCollage(QImage &collage, const QImage &grayscaleImage); diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp index 659925a1c68..3913414b65a 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp @@ -135,7 +135,8 @@ QFuture bgrImages = QtConcurrent::mapped(images, // Create a set of the lengths of all strings in a list. QStringList strings = ...; -QFuture > wordLengths = QtConcurrent::mappedReduced(strings, &QString::length, &QSet::insert); +QFuture> wordLengths = QtConcurrent::mappedReduced(strings, &QString::length, + qOverload(&QSet::insert)); //! [8] @@ -150,7 +151,8 @@ QFuture averageWordLength = QtConcurrent::mappedReduced(strings, &QString:: // Create a set of the color distribution of all images in a list. extern int colorDistribution(const QImage &string); QList images = ...; -QFuture > totalColorDistribution = QtConcurrent::mappedReduced(images, colorDistribution, QSet::insert); +QFuture> totalColorDistribution = QtConcurrent::mappedReduced(images, colorDistribution, + qOverload(&QSet::insert)); //! [9] diff --git a/src/concurrent/qtconcurrentfilter.cpp b/src/concurrent/qtconcurrentfilter.cpp index 2bec2a6eb9c..b5f7e95a905 100644 --- a/src/concurrent/qtconcurrentfilter.cpp +++ b/src/concurrent/qtconcurrentfilter.cpp @@ -134,7 +134,10 @@ \snippet code/src_concurrent_qtconcurrentfilter.cpp 7 - Note that when using QtConcurrent::filteredReduced(), you can mix the use of + Note the use of qOverload. It is needed to resolve the ambiguity for the + methods, that have multiple overloads. + + Also note that when using QtConcurrent::filteredReduced(), you can mix the use of normal and member functions freely: \snippet code/src_concurrent_qtconcurrentfilter.cpp 8 diff --git a/src/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp index d68dd63bb84..e0a2eb4a885 100644 --- a/src/concurrent/qtconcurrentmap.cpp +++ b/src/concurrent/qtconcurrentmap.cpp @@ -260,7 +260,10 @@ \snippet code/src_concurrent_qtconcurrentmap.cpp 8 - Note that when using QtConcurrent::mappedReduced(), you can mix the use of + Note the use of qOverload. It is needed to resolve the ambiguity for the + methods, that have multiple overloads. + + Also note that when using QtConcurrent::mappedReduced(), you can mix the use of normal and member functions freely: \snippet code/src_concurrent_qtconcurrentmap.cpp 9