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>
bb10
Paul Wicking 2018-04-10 15:11:22 +02:00
parent 370cd37cea
commit 941db4e0bb
1 changed files with 3 additions and 2 deletions

View File

@ -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]