QGIS API Documentation 4.3.0-Master (8c22baaae17)
Loading...
Searching...
No Matches
QgsFutureUtils Class Reference

Provides utilities for handling QFutures. More...

#include <qgsfutureutils.h>

Static Public Member Functions

static void cancelChain (QFuture< void > future)
 Runs future.cancelChain() if supported by Qt version, future.cancel() otherwise.
static QFuture< void > clone (QFuture< void > base)
 Returns a future that will finish at the same time base will.
template<typename... Ts>
static QFuture< std::tuple< Ts... > > combine (QFuture< Ts >... futures)
 Converts multiple futures into a single future that will finish when all its parts have finished.
static void waitForFinished (QFuture< void > future)
 Waits for the future to become finished without blocking the main thread's event loop.

Detailed Description

Provides utilities for handling QFutures.

Since
QGIS 4.4

Definition at line 70 of file qgsfutureutils.h.

Member Function Documentation

◆ cancelChain()

void QgsFutureUtils::cancelChain ( QFuture< void > future)
static

Runs future.cancelChain() if supported by Qt version, future.cancel() otherwise.

Since
QGIS 4.4

Definition at line 103 of file qgsfutureutils.cpp.

◆ clone()

QFuture< void > QgsFutureUtils::clone ( QFuture< void > base)
static

Returns a future that will finish at the same time base will.

Useful since you can only attach one continuation to a single future.

Since
QGIS 4.4

Definition at line 92 of file qgsfutureutils.cpp.

◆ combine()

template<typename... Ts>
QFuture< std::tuple< Ts... > > QgsFutureUtils::combine ( QFuture< Ts >... futures)
inlinestatic

Converts multiple futures into a single future that will finish when all its parts have finished.

Like QtFuture::whenAll, but more ergonomic.

Since
QGIS 4.4

Definition at line 103 of file qgsfutureutils.h.

◆ waitForFinished()

void QgsFutureUtils::waitForFinished ( QFuture< void > future)
static

Waits for the future to become finished without blocking the main thread's event loop.

Since
QGIS 4.4

Definition at line 61 of file qgsfutureutils.cpp.


The documentation for this class was generated from the following files: