summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2018-04-10 15:11:22 +0200
committerPaul Wicking <paul.wicking@qt.io>2018-04-19 15:33:31 +0000
commit941db4e0bb3170b6bc3cf775f150a226754e6285 (patch)
tree10175f705bf1cec0ad154c98f57cad6c371e8b13
parent370cd37ceabc6a27f4140a35180502eed745b5f2 (diff)
Doc: Update QtConcurrent::mapped example snippet
Wrap current example code snippet in std::function as a work-around, as suggested in comment to QTBUG-61145 (see history tab) with the same issue. Task-number: QTBUG-67603 Change-Id: I6875b31d8e983e234b88384c7d76917ac144f953 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp
index 9cf82c786a..8424dbe97d 100644
--- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp
+++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp
@@ -172,9 +172,10 @@ QFuture<QImage> thumbNails =
//! [13]
QList<QImage> images = ...;
-QFuture<QImage> thumbnails = QtConcurrent::mapped(images, [](const QImage &img) {
+std::function<QImage(const QImage &)> scale = [](const QImage &img) {
return img.scaledToWidth(100, Qt::SmoothTransformation);
-});
+};
+QFuture<QImage> thumbnails = QtConcurrent::mapped(images, scale);
//! [13]
//! [14]