CopperSpice API  1.7.2
QFutureWatcherBase Class Referenceabstract

Base class for QFutureWatcher. More...

Inheritance diagram for QFutureWatcherBase:
QObject QFutureWatcher< T >

Public Signals

void canceled ()
 
void finished ()
 
void paused ()
 
void progressRangeChanged (int minimum, int maximum)
 
void progressTextChanged (const QString &progressText)
 
void progressValueChanged (int progressValue)
 
void resultReadyAt (int index)
 
void resultsReadyAt (int beginIndex, int endIndex)
 
void resumed ()
 
void started ()
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 

Public Slots

void cancel ()
 
void pause ()
 
void resume ()
 
void setPaused (bool paused)
 
void togglePaused ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Public Methods

bool event (QEvent *event) override
 
bool isCanceled () const
 
bool isFinished () const
 
bool isPaused () const
 
bool isRunning () const
 
bool isStarted () const
 
int progressMaximum () const
 
int progressMinimum () const
 
QString progressText () const
 
int progressValue () const
 
void setPendingResultsLimit (int limit)
 
void waitForFinished ()
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &objName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 

Additional Inherited Members

- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The QFutureWatcherBase is the base class for QFutureWatcher. The QFutureWatcherBase class is used internally by CopperSpice and is not part of the public API.

Method Documentation

void QFutureWatcherBase::cancel ( )
slot

Cancels the asynchronous computation represented by the future(). Note, the cancellation is asynchronous. Use waitForFinished() after calling cancel() when you need synchronous cancellation.

Currently available results may still be accessed on a canceled QFuture, but new results will not become available after calling this function. Also, this QFutureWatcher will not deliver progress and result ready signals once canceled. This includes the progressValueChanged(), progressRangeChanged(), progressTextChanged(), resultReadyAt(), and resultsReadyAt() signals.

Be aware that not all asynchronous computations can be canceled. For example, the QFuture returned by QtConcurrent::run() can not be canceled; but the QFuture returned by QtConcurrent::mappedReduced() can.

void QFutureWatcherBase::canceled ( )
signal

This signal is emitted if the watched future is canceled.

bool QFutureWatcherBase::event ( QEvent event)
overridevirtual

This virtual method receives events to an object and should return true if the event event was recognized and processed. The event() method can be overridden to customize the behavior of an object.

See also
installEventFilter(), timerEvent(), QApplication::sendEvent(), QApplication::postEvent(), QWidget::event()

Reimplemented from QObject.

void QFutureWatcherBase::finished ( )
signal

This signal is emitted when the watched future finishes.

bool QFutureWatcherBase::isCanceled ( ) const

Returns true if the asynchronous computation has been canceled with the cancel() function, otherwise returns false.

Be aware that the computation may still be running even though this function returns true. See cancel() for more details.

bool QFutureWatcherBase::isFinished ( ) const

Returns true if the asynchronous computation represented by the future() has finished, otherwise returns false.

bool QFutureWatcherBase::isPaused ( ) const

Returns true if the asynchronous computation has been paused with the pause() function, otherwise returns false.

Be aware that the computation may still be running even though this function returns true. See setPaused() for more details.

See also
setPaused(), togglePaused()
bool QFutureWatcherBase::isRunning ( ) const

Returns true if the asynchronous computation represented by the future() is currently running, otherwise returns false.

bool QFutureWatcherBase::isStarted ( ) const

Returns true if the asynchronous computation represented by the future() has been started, otherwise returns false.

void QFutureWatcherBase::pause ( )
slot

Pauses the asynchronous computation represented by the future(). This is a convenience method that simply calls setPaused(true).

See also
resume()
void QFutureWatcherBase::paused ( )
signal

This signal is emitted when the watched future is paused.

See also
setPaused()
int QFutureWatcherBase::progressMaximum ( ) const

Returns the maximum progressValue().

See also
progressValue(), progressMinimum()
int QFutureWatcherBase::progressMinimum ( ) const

Returns the minimum progressValue().

See also
progressValue(), progressMaximum()
void QFutureWatcherBase::progressRangeChanged ( int  minimum,
int  maximum 
)
signal

The progress range for the watched future has changed to minimum and maximum

QString QFutureWatcherBase::progressText ( ) const

Returns the (optional) textual representation of the progress as reported by the asynchronous computation.

Be aware that not all computations provide a textual representation of the progress, and as such, this function may return an empty string.

void QFutureWatcherBase::progressTextChanged ( const QString progressText)
signal

This signal is emitted when the watched future reports textual progress information, progressText.

int QFutureWatcherBase::progressValue ( ) const

Returns the current progress value, which is between the progressMinimum() and progressMaximum().

See also
progressMinimum(), progressMaximum()
void QFutureWatcherBase::progressValueChanged ( int  progressValue)
signal

This signal is emitted when the watched future reports progress, progressValue gives the current progress. In order to avoid overloading the GUI event loop, QFutureWatcher limits the progress signal emission rate. This means that listeners connected to this slot might not get all progress reports the future makes. The last progress update (where progressValue equals the maximum value) will always be delivered.

void QFutureWatcherBase::resultReadyAt ( int  index)
signal

This signal is emitted when the watched future reports a ready result at index. If the future reports multiple results, the index will indicate which one it is. Results can be reported out-of-order. To get the result, call future().result(index);

void QFutureWatcherBase::resultsReadyAt ( int  beginIndex,
int  endIndex 
)
signal

This signal is emitted when the watched future reports ready results. The results are indexed from beginIndex to endIndex.

void QFutureWatcherBase::resume ( )
slot

Resumes the asynchronous computation represented by the future(). This is a convenience method that simply calls setPaused(false).

See also
pause()
void QFutureWatcherBase::resumed ( )
signal

This signal is emitted when the watched future is resumed.

void QFutureWatcherBase::setPaused ( bool  paused)
slot

If paused is true, this function pauses the asynchronous computation represented by the future(). If the computation is already paused, this function does nothing. This QFutureWatcher will stop delivering progress and result ready signals while the future is paused. Signal delivery will continue once the computation is resumed.

If paused is false, this function resumes the asynchronous computation. If the computation was not previously paused, this function does nothing.

Be aware that not all computations can be paused. For example, the QFuture returned by QtConcurrent::run() can not be paused; but the QFuture returned by QtConcurrent::mappedReduced() can.

See also
paused(), pause(), resume(), togglePaused()
void QFutureWatcherBase::setPendingResultsLimit ( int  limit)

The setPendingResultsLimit() provides throttling control. When the number of pending resultReadyAt() or resultsReadyAt() signals exceeds the limit, the computation represented by the future will be throttled automatically. The computation will resume once the number of pending signals drops below the limit.

void QFutureWatcherBase::started ( )
signal

This signal is emitted when this QFutureWatcher starts watching the future set with setFuture().

void QFutureWatcherBase::togglePaused ( )
slot

Toggles the paused state of the asynchronous computation. In other words, if the computation is currently paused, calling this function resumes it; if the computation is running, it becomes paused. This is a convenience method for calling setPaused(!isPaused()).

See also
setPaused(), pause(), resume()
void QFutureWatcherBase::waitForFinished ( )

Waits for the asynchronous computation to finish (including cancel()ed computations).