KAsync::FutureWatcher

Search for usage in LXR

KAsync::FutureWatcher< T > Class Template Reference

#include <future.h>

Inherits FutureWatcherBase.

Signals

void futureProgress (qreal progress)
 
void futureReady ()
 

Public Member Functions

 FutureWatcher (QObject *parent=nullptr)
 
KAsync::Future< T > future () const
 
void setFuture (const KAsync::Future< T > &future)
 

Detailed Description

template<typename T>
class KAsync::FutureWatcher< T >

The FutureWatcher allows monitoring of Job results using signals and slots.

FutureWatcher is returned by Job upon execution. User can then connect to its futureReady() and futureProgress() signals to be notified about progress of the asynchronous job. When futureReady() signal is emitted, the result of the job is available in Future::value().

Definition at line 445 of file future.h.

Constructor & Destructor Documentation

template<typename T>
KAsync::FutureWatcher< T >::FutureWatcher ( QObject parent = nullptr)

Constructs a new FutureWatcher that can watch for status of Future<T>.

Definition at line 455 of file future.h.

Member Function Documentation

template<typename T>
KAsync::Future<T> KAsync::FutureWatcher< T >::future ( ) const

Returns currently watched future.

Definition at line 475 of file future.h.

template<typename T>
void KAsync::FutureWatcher< T >::futureProgress ( qreal  progress)
signal

The signal is emitted when progress of the execution changes.

This has to be explicitly supported by the job being executed, otherwise the signal is not emitted.

See also
Future::setProgress()
template<typename T>
void KAsync::FutureWatcher< T >::futureReady ( )
signal

The signal is emitted when the execution has finished and the result can be collected.

See also
Future::setFinished(), Future::setError()
template<typename T>
void KAsync::FutureWatcher< T >::setFuture ( const KAsync::Future< T > &  future)

Set future to watch.

Parameters
futureFuture object to watch

Definition at line 467 of file future.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Apr 10 2021 23:07:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.