43 #include <QtCore/qglobal.h>
44 #include <QtCore/qfutureinterface.h>
54 template<
class T,
class U>
62 static_assert (std::is_move_constructible_v<T>
63 || std::is_same_v<T, void>,
64 "A move-constructible type or type void is required");
76 if (d.d && !(d.loadState() & QFutureInterfaceBase::State::Finished)) {
78 d.cleanContinuation();
84 template<
typename U,
typename = QtPrivate::EnableIfSameOrConvertible<U, T>>
87 return d.reportResult(std::forward<U>(
result),
index);
89 #ifndef QT_NO_EXCEPTIONS
91 #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
97 void start() { d.reportStarted(); }
98 void finish() { d.reportFinished(); }
109 d.setProgressValueAndText(progressValue, progressText);
117 #if defined(Q_CLANG_QDOC)
The QException class provides a base class for exceptions that can be transferred across threads.
QPromise(QFutureInterface< T > &&other) noexcept
void setProgressValue(int progressValue)
QFuture< T > future() const
void setException(const QException &e)
void setProgressRange(int minimum, int maximum)
bool addResult(U &&result, int index=-1)
void setProgressValueAndText(int progressValue, const QString &progressText)
void suspendIfRequested()
void setException(const std::exception_ptr &e)
void swap(QPromise< T > &other) noexcept
The QString class provides a Unicode character string.
auto it unsigned count const
std::enable_if_t< std::is_convertible_v< T, U > > EnableIfSameOrConvertible
#define Q_DISABLE_COPY(Class)
#define QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(Class)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
QT_REQUIRE_CONFIG(future)
void swap(QPromise< T > &a, QPromise< T > &b) noexcept
QFuture< void > future
[5]