CopperSpice API
1.9.2
|
Base class for QFutureWatcher. More...
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< QString > | dynamicPropertyNames () const |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &childName=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 QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | 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) |
QThread * | thread () const |
Protected Methods | |
void | connectNotify (const QMetaMethod &signal) const override |
void | disconnectNotify (const QMetaMethod &signal) const override |
Protected Methods inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
bool | isSignalConnected (const QMetaMethod &signalMethod) const |
int | receivers (const QString &signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
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) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
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 QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
Properties inherited from QObject | |
objectName | |
Related Functions inherited from QObject | |
T | qobject_cast (QObject *object) |
QObjectList | |
The QFutureWatcherBase is the base class for QFutureWatcher. The QFutureWatcherBase class is used internally by CopperSpice and is not part of the public API.
|
slot |
Cancels the asynchronous computation represented by the future(). 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.
|
signal |
This signal is emitted if the watched future is canceled.
|
overrideprotectedvirtual |
This method is called when a connection has been made to signalMethod in this object.
Reimplemented from QObject::connectNotify()
|
overrideprotectedvirtual |
This method is called when a slot is disconnected from signalMethod in this object.
Reimplemented from QObject::disconnectNotify()
|
overridevirtual |
Receives events to an object and should return true if the given event was recognized and processed. This method can be overridden to customize the event handling for an object.
Reimplemented from QObject::event()
|
signal |
This signal is emitted when the watched future finishes.
bool QFutureWatcherBase::isCanceled | ( | ) | const |
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.
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.
|
slot |
Pauses the asynchronous computation represented by the future(). Equivalent to calling setPaused(true).
|
signal |
This signal is emitted when the watched future is paused.
int QFutureWatcherBase::progressMaximum | ( | ) | const |
Returns the maximum progressValue().
int QFutureWatcherBase::progressMinimum | ( | ) | const |
Returns the minimum progressValue().
|
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.
|
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().
|
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.
|
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);
|
signal |
This signal is emitted when the watched future reports ready results. The results are indexed from beginIndex to endIndex.
|
slot |
Resumes the computation represented by the future(). Equivalent to calling setPaused(false).
|
signal |
This signal is emitted when the watched future is resumed.
|
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.
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.
|
signal |
This signal is emitted when this QFutureWatcher starts watching the future set with setFuture().
|
slot |
Toggles the paused state of the asynchronous computation. If the computation is currently paused, calling this method will resume it. If the computation is running, it becomes paused.
void QFutureWatcherBase::waitForFinished | ( | ) |
Waits for the asynchronous computation to finish (including cancel()ed computations).