Since: 0.1.0

qPromise(T value) -> QPromise<R>

Similar to the QPromise<T>::resolve static method, creates a promise resolved from a given value without the extra typing:

auto promise = qPromise();                // QPromise<void>
auto promise = qPromise(42);              // QPromise<int>
auto promise = qPromise(QString("foo"));  // QPromise<QString>

This method also allows to convert QFuture<T> to QPromise<T> delayed until the QFuture is finished (read more).

Last Updated: 9/9/2018, 8:55:07 AM