Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
None
-
6.0
-
None
-
-
8
-
Team A Foundation Sprint 55
Description
When creating a Async pipeline sometimes QFuture.then() may return QFuture. It's useful to unwrap the returned QFuture such there's not QFuture<QFuture<T>>. For example:
auto download = [](QUrl url) { ... return QList<Tile>({tile1, ..., tileX}); } auto processTiles = [](QList<Tile> tiles) { QFuture<QImage> future = QtConcurrent::mappedReduced(tiles, processTile, //Map function reduceTiles) //Reduce function return future; } auto saveImage = [](QImage image) { image.save(...); } auto future = QtConcurrent::run(download, url) .then(processTiles) .then(saveImage)
Things to consider when implementing unwrapped QFutures this:
- Handling / propagating progress
- Handling errors
- Handling canceling and pausingĀ
Attachments
For Gerrit Dashboard: QTBUG-86725 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
404949,15 | Add support for unwrapping QFuture<QFuture<T>> | dev | qt/qtbase | Status: MERGED | +2 | 0 |