Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
 
void cancelChain ()
 
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::CompactContinuation
 
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 261 of file qfuture.h.

◆ ResultType

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

Definition at line 129 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.

References QFuture().

Referenced by QFuture().

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

◆ 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.

References const_iterator.

+ Here is the call graph for this function:

◆ 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.

References const_iterator.

+ Here is the call graph for this function:

◆ 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.

References const_iterator.

+ Here is the call graph for this function:

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 264 of file qfuture.h.

◆ cancel()

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

Definition at line 64 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ cancelChain()

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

Definition at line 66 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ constBegin()

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

Definition at line 267 of file qfuture.h.

◆ constEnd()

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

Definition at line 273 of file qfuture.h.

◆ end()

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

Definition at line 270 of file qfuture.h.

◆ isCanceled()

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

Definition at line 65 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ isFinished()

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

Definition at line 95 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ isResultReadyAt()

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

Definition at line 112 of file qfuture.h.

◆ isRunning()

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

Definition at line 96 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ isStarted()

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

Definition at line 94 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ isSuspended()

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

Definition at line 88 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ isSuspending()

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

Definition at line 87 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ isValid()

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

Definition at line 126 of file qfuture.h.

◆ onCanceled() [1/2]

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

Definition at line 395 of file qfuture.h.

◆ onCanceled() [2/2]

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

Definition at line 405 of file qfuture.h.

◆ onFailed() [1/2]

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

Definition at line 373 of file qfuture.h.

◆ onFailed() [2/2]

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

Definition at line 383 of file qfuture.h.

◆ 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 const_iterator.

+ Here is the call graph for this function:

◆ progressMaximum()

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

Definition at line 101 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ progressMinimum()

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

Definition at line 100 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ progressText()

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

Definition at line 102 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ progressValue()

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

Definition at line 99 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ result()

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

Definition at line 310 of file qfuture.h.

◆ resultAt()

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

Definition at line 318 of file qfuture.h.

◆ resultCount()

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

Definition at line 98 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ results()

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

Definition at line 115 of file qfuture.h.

◆ resume()

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

Definition at line 91 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ setSuspended()

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

Definition at line 89 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ suspend()

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

Definition at line 90 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ takeResult()

template<typename T>
template<typename U = T, typename = QtPrivate::EnableForNonVoid<U>>
T QFuture< T >::takeResult ( )
inline

Definition at line 118 of file qfuture.h.

◆ then() [1/8]

template<typename T>
template<class Function>
QFuture< ResultType< Function > > QFuture< T >::then ( Function && 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 332 of file qfuture.h.

◆ 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 361 of file qfuture.h.

◆ 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 340 of file qfuture.h.

◆ 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 350 of file qfuture.h.

◆ toggleSuspended()

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

Definition at line 92 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

◆ unwrap()

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

Definition at line 415 of file qfuture.h.

◆ waitForFinished()

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

Definition at line 103 of file qfuture.h.

References const_iterator.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ QFuture

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

Definition at line 279 of file qfuture.h.

◆ const_iterator

◆ QFutureInterfaceBase

template<typename T>
friend class QFutureInterfaceBase
friend

Definition at line 281 of file qfuture.h.

◆ QFutureWatcher< T >

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

Definition at line 273 of file qfuture.h.

◆ QtPrivate::CanceledHandler

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

Definition at line 287 of file qfuture.h.

◆ QtPrivate::CompactContinuation

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

Definition at line 284 of file qfuture.h.

◆ QtPrivate::FailureHandler

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

Definition at line 291 of file qfuture.h.

◆ QtPrivate::UnwrapHandler

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

Definition at line 297 of file qfuture.h.

◆ QtPrivate::WhenAnyContext

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

Definition at line 295 of file qfuture.h.


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