Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QFuture< T > Class Template Reference

#include <qfuture.h>

+ Collaboration diagram for QFuture< T >:

Classes

class  const_iterator
 

Public Types

template<class Function >
using ResultType = typename QtPrivate::ResultTypeHelper<Function, T>::ResultType
 
typedef const_iterator ConstIterator
 

Public Member Functions

 QFuture ()
 
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
 QFuture (QFutureInterface< T > *p)
 
template<typename U = T, typename = QtPrivate::EnableForVoid<U>>
 QFuture (QFutureInterfaceBase *p)
 
template<typename U , typename V = T, typename = QtPrivate::EnableForVoid<V>>
 QFuture (const QFuture< U > &other)
 
template<typename U , typename V = T, typename = QtPrivate::EnableForVoid<V>>
QFuture< void > & operator= (const QFuture< U > &other)
 
void cancel ()
 
bool isCanceled () const
 
bool isSuspending () const
 
bool isSuspended () const
 
void setSuspended (bool suspend)
 
void suspend ()
 
void resume ()
 
void toggleSuspended ()
 
bool isStarted () const
 
bool isFinished () const
 
bool isRunning () const
 
int resultCount () const
 
int progressValue () const
 
int progressMinimum () const
 
int progressMaximum () const
 
QString progressText () const
 
void waitForFinished ()
 
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
result () const
 
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
resultAt (int index) const
 
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
bool isResultReadyAt (int resultIndex) const
 
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
QList< T > results () const
 
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
takeResult ()
 
bool isValid () const
 
template<class Function >
QFuture< ResultType< Function > > then (Function &&function)
 
template<class Function >
QFuture< ResultType< Function > > then (QtFuture::Launch policy, Function &&function)
 
template<class Function >
QFuture< ResultType< Function > > then (QThreadPool *pool, Function &&function)
 
template<class Function >
QFuture< ResultType< Function > > then (QObject *context, Function &&function)
 
template<class Function , typename = std::enable_if_t<!QtPrivate::ArgResolver<Function>::HasExtraArgs>>
QFuture< T > onFailed (Function &&handler)
 
template<class Function , typename = std::enable_if_t<!QtPrivate::ArgResolver<Function>::HasExtraArgs>>
QFuture< T > onFailed (QObject *context, Function &&handler)
 
template<class Function , typename = std::enable_if_t<std::is_invocable_r_v<T, Function>>>
QFuture< T > onCanceled (Function &&handler)
 
template<class Function , typename = std::enable_if_t<std::is_invocable_r_v<T, Function>>>
QFuture< T > onCanceled (QObject *context, Function &&handler)
 
template<class U = T, typename = std::enable_if_t<QtPrivate::isQFutureV<U>>>
auto unwrap ()
 
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator begin () const
 
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator constBegin () const
 
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator end () const
 
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator constEnd () const
 
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > then (Function &&function)
 
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > then (QtFuture::Launch policy, Function &&function)
 
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > then (QThreadPool *pool, Function &&function)
 
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > then (QObject *context, Function &&function)
 

Friends

class const_iterator
 
class QFutureWatcher< T >
 
template<class U >
class QFuture
 
class QFutureInterfaceBase
 
template<class Function , class ResultType , class ParentResultType >
class QtPrivate::Continuation
 
template<class Function , class ResultType >
class QtPrivate::CanceledHandler
 
template<class Function , class ResultType >
class QtPrivate::FailureHandler
 
template<typename ResultType >
struct QtPrivate::WhenAnyContext
 
struct QtPrivate::UnwrapHandler
 

Detailed Description

template<typename T>
class QFuture< T >

Definition at line 25 of file qfuture.h.

Member Typedef Documentation

◆ ConstIterator

template<typename T >
typedef const_iterator QFuture< T >::ConstIterator

Definition at line 260 of file qfuture.h.

◆ ResultType

template<typename T >
template<class Function >
using QFuture< T >::ResultType = typename QtPrivate::ResultTypeHelper<Function, T>::ResultType

Definition at line 128 of file qfuture.h.

Constructor & Destructor Documentation

◆ QFuture() [1/4]

template<typename T >
QFuture< T >::QFuture ( )
inline

Definition at line 31 of file qfuture.h.

◆ QFuture() [2/4]

template<typename T >
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
QFuture< T >::QFuture ( QFutureInterface< T > * p)
inlineexplicit

Definition at line 36 of file qfuture.h.

◆ QFuture() [3/4]

template<typename T >
template<typename U = T, typename = QtPrivate::EnableForVoid<U>>
QFuture< T >::QFuture ( QFutureInterfaceBase * p)
inlineexplicit

Definition at line 41 of file qfuture.h.

◆ QFuture() [4/4]

template<typename T >
template<typename U , typename V = T, typename = QtPrivate::EnableForVoid<V>>
QFuture< T >::QFuture ( const QFuture< U > & other)
inlineexplicit

Definition at line 47 of file qfuture.h.

Member Function Documentation

◆ begin()

template<typename T >
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator QFuture< T >::begin ( ) const
inline

Definition at line 263 of file qfuture.h.

References QFuture< T >::const_iterator.

◆ cancel()

template<typename T >
void QFuture< T >::cancel ( )
inline

Definition at line 64 of file qfuture.h.

◆ constBegin()

template<typename T >
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator QFuture< T >::constBegin ( ) const
inline

Definition at line 266 of file qfuture.h.

References QFuture< T >::const_iterator.

◆ constEnd()

template<typename T >
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator QFuture< T >::constEnd ( ) const
inline

Definition at line 272 of file qfuture.h.

References QFuture< T >::const_iterator.

◆ end()

template<typename T >
template<class U = T, typename = QtPrivate::EnableForNonVoid<U>>
const_iterator QFuture< T >::end ( ) const
inline

Definition at line 269 of file qfuture.h.

References QFuture< T >::const_iterator.

◆ isCanceled()

template<typename T >
bool QFuture< T >::isCanceled ( ) const
inline

Definition at line 65 of file qfuture.h.

◆ isFinished()

template<typename T >
bool QFuture< T >::isFinished ( ) const
inline

Definition at line 94 of file qfuture.h.

◆ isResultReadyAt()

template<typename T >
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
bool QFuture< T >::isResultReadyAt ( int resultIndex) const
inline

Definition at line 111 of file qfuture.h.

◆ isRunning()

template<typename T >
bool QFuture< T >::isRunning ( ) const
inline

Definition at line 95 of file qfuture.h.

◆ isStarted()

template<typename T >
bool QFuture< T >::isStarted ( ) const
inline

Definition at line 93 of file qfuture.h.

◆ isSuspended()

template<typename T >
bool QFuture< T >::isSuspended ( ) const
inline

Definition at line 87 of file qfuture.h.

◆ isSuspending()

template<typename T >
bool QFuture< T >::isSuspending ( ) const
inline

Definition at line 86 of file qfuture.h.

◆ isValid()

template<typename T >
bool QFuture< T >::isValid ( ) const
inline

Definition at line 125 of file qfuture.h.

◆ onCanceled() [1/2]

template<class T >
template<class Function , typename >
QFuture< T > QFuture< T >::onCanceled ( Function && handler)

Definition at line 394 of file qfuture.h.

References create(), and QFutureInterfaceBase::Pending.

+ Here is the call graph for this function:

◆ onCanceled() [2/2]

template<class T >
template<class Function , typename >
QFuture< T > QFuture< T >::onCanceled ( QObject * context,
Function && handler )

Definition at line 404 of file qfuture.h.

References context, create(), and QFutureInterfaceBase::Pending.

+ Here is the call graph for this function:

◆ onFailed() [1/2]

template<class T >
template<class Function , typename >
QFuture< T > QFuture< T >::onFailed ( Function && handler)

Definition at line 372 of file qfuture.h.

References create(), and QFutureInterfaceBase::Pending.

+ Here is the call graph for this function:

◆ onFailed() [2/2]

template<class T >
template<class Function , typename >
QFuture< T > QFuture< T >::onFailed ( QObject * context,
Function && handler )

Definition at line 382 of file qfuture.h.

References context, create(), and QFutureInterfaceBase::Pending.

+ Here is the call graph for this function:

◆ operator=()

template<typename T >
template<typename U , typename V = T, typename = QtPrivate::EnableForVoid<V>>
QFuture< void > & QFuture< T >::operator= ( const QFuture< U > & other)
inline

Definition at line 52 of file qfuture.h.

References other().

+ Here is the call graph for this function:

◆ progressMaximum()

template<typename T >
int QFuture< T >::progressMaximum ( ) const
inline

Definition at line 100 of file qfuture.h.

◆ progressMinimum()

template<typename T >
int QFuture< T >::progressMinimum ( ) const
inline

Definition at line 99 of file qfuture.h.

◆ progressText()

template<typename T >
QString QFuture< T >::progressText ( ) const
inline

Definition at line 101 of file qfuture.h.

◆ progressValue()

template<typename T >
int QFuture< T >::progressValue ( ) const
inline

Definition at line 98 of file qfuture.h.

◆ result()

template<typename T >
template<typename U , typename >
T QFuture< T >::result ( ) const
inline

Definition at line 309 of file qfuture.h.

References d.

Referenced by QtPrivate::fulfillPromise().

+ Here is the caller graph for this function:

◆ resultAt()

template<typename T >
template<typename U , typename >
T QFuture< T >::resultAt ( int index) const
inline

Definition at line 317 of file qfuture.h.

References d.

◆ resultCount()

template<typename T >
int QFuture< T >::resultCount ( ) const
inline

Definition at line 97 of file qfuture.h.

◆ results()

template<typename T >
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
QList< T > QFuture< T >::results ( ) const
inline

Definition at line 114 of file qfuture.h.

◆ resume()

template<typename T >
void QFuture< T >::resume ( )
inline

Definition at line 90 of file qfuture.h.

References QFuture< T >::setSuspended().

+ Here is the call graph for this function:

◆ setSuspended()

template<typename T >
void QFuture< T >::setSuspended ( bool suspend)
inline

Definition at line 88 of file qfuture.h.

References QFuture< T >::suspend().

Referenced by QFuture< T >::resume(), and QFuture< T >::suspend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ suspend()

template<typename T >
void QFuture< T >::suspend ( )
inline

Definition at line 89 of file qfuture.h.

References QFuture< T >::setSuspended().

Referenced by QFuture< T >::setSuspended().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ takeResult()

◆ then() [1/8]

template<typename T >
template<class Function >
QFuture< ResultType< Function > > QFuture< T >::then ( Function && function)

Referenced by QtPrivate::addCompletionHandlersImpl().

+ Here is the caller graph for this function:

◆ then() [2/8]

template<typename T >
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > QFuture< T >::then ( Function && function)

Definition at line 331 of file qfuture.h.

References QtFuture::Sync.

◆ then() [3/8]

template<typename T >
template<class Function >
QFuture< ResultType< Function > > QFuture< T >::then ( QObject * context,
Function && function )

◆ then() [4/8]

template<typename T >
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > QFuture< T >::then ( QObject * context,
Function && function )

Definition at line 360 of file qfuture.h.

References context, create(), and QFutureInterfaceBase::Pending.

+ Here is the call graph for this function:

◆ then() [5/8]

template<typename T >
template<class Function >
QFuture< ResultType< Function > > QFuture< T >::then ( QtFuture::Launch policy,
Function && function )

◆ then() [6/8]

template<typename T >
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > QFuture< T >::then ( QtFuture::Launch policy,
Function && function )

Definition at line 339 of file qfuture.h.

References create(), QFutureInterfaceBase::Pending, and policy.

+ Here is the call graph for this function:

◆ then() [7/8]

template<typename T >
template<class Function >
QFuture< ResultType< Function > > QFuture< T >::then ( QThreadPool * pool,
Function && function )

◆ then() [8/8]

template<typename T >
template<class Function >
QFuture< typename QFuture< T >::template ResultType< Function > > QFuture< T >::then ( QThreadPool * pool,
Function && function )

Definition at line 349 of file qfuture.h.

References create(), QFutureInterfaceBase::Pending, and pool.

+ Here is the call graph for this function:

◆ toggleSuspended()

template<typename T >
void QFuture< T >::toggleSuspended ( )
inline

Definition at line 91 of file qfuture.h.

◆ unwrap()

template<class T >
template<class U , typename >
auto QFuture< T >::unwrap ( )

Definition at line 414 of file qfuture.h.

References QtPrivate::UnwrapHandler::unwrapImpl().

+ Here is the call graph for this function:

◆ waitForFinished()

template<typename T >
void QFuture< T >::waitForFinished ( )
inline

Definition at line 102 of file qfuture.h.

Referenced by QFFmpegMediaPlayer::~QFFmpegMediaPlayer(), QtConcurrent::blockingFilter(), QtConcurrent::blockingFilter(), QtConcurrent::blockingMap(), QtConcurrent::blockingMap(), QtConcurrent::blockingMap(), QtConcurrent::blockingMap(), and QFFmpegMediaPlayer::setMedia().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QFuture

template<typename T >
template<class U >
friend class QFuture
friend

Definition at line 278 of file qfuture.h.

◆ const_iterator

template<typename T >
friend class const_iterator
friend

◆ QFutureInterfaceBase

template<typename T >
friend class QFutureInterfaceBase
friend

Definition at line 280 of file qfuture.h.

◆ QFutureWatcher< T >

template<typename T >
friend class QFutureWatcher< T >
friend

Definition at line 272 of file qfuture.h.

◆ QtPrivate::CanceledHandler

template<typename T >
template<class Function , class ResultType >
friend class QtPrivate::CanceledHandler
friend

Definition at line 286 of file qfuture.h.

◆ QtPrivate::Continuation

template<typename T >
template<class Function , class ResultType , class ParentResultType >
friend class QtPrivate::Continuation
friend

Definition at line 283 of file qfuture.h.

◆ QtPrivate::FailureHandler

template<typename T >
template<class Function , class ResultType >
friend class QtPrivate::FailureHandler
friend

Definition at line 290 of file qfuture.h.

◆ QtPrivate::UnwrapHandler

template<typename T >
friend struct QtPrivate::UnwrapHandler
friend

Definition at line 296 of file qfuture.h.

◆ QtPrivate::WhenAnyContext

template<typename T >
template<typename ResultType >
friend struct QtPrivate::WhenAnyContext
friend

Definition at line 294 of file qfuture.h.


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