QFutureWatcherBase Class
The QFutureWatcherBase class is the base of QFutureWatcher, and holds its signals and slots. More…
| Header | #include <QFutureWatcherBase> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Inherits | QObject |
| Inherited by | QFutureWatcher |
List of all members, including inherited members
Public Functions
| QFutureWatcherBase(QObject *parent = nullptr) | |
| ~QFutureWatcherBase() | |
| int | progressValue() const |
| int | progressMinimum() const |
| int | progressMaximum() const |
| QString | progressText() const |
| bool | isStarted() const |
| bool | isFinished() const |
| bool | isRunning() const |
| bool | isCanceled() const |
| bool | isSuspending() const |
| bool | isSuspended() const |
| bool | isPaused() const |
| void | waitForFinished() |
| void | setPendingResultsLimit(int limit) |
Reimplemented Public Functions
Public Slots
| void | cancel() |
| void | setSuspended(bool suspend) |
| void | suspend() |
| void | resume() |
| void | toggleSuspended() |
| void | setPaused(bool paused) |
| void | pause() |
| void | togglePaused() |
Signals
| void | started() |
| void | finished() |
| void | canceled() |
| void | paused() |
| void | suspending() |
| void | suspended() |
| void | resumed() |
| void | resultReadyAt(int index) |
| void | resultsReadyAt(int beginIndex, int endIndex) |
| void | progressRangeChanged(int minimum, int maximum) |
| void | progressValueChanged(int progressValue) |
| void | progressTextChanged(const QString &progressText) |
Detailed Description
See also QFutureWatcher.
Differences from Qt
There is no connectNotify(): the watcher always listens to its future. The futureInterface() functions and the connectOutputInterface() functions are internal.
Member Function Documentation
QFutureWatcherBase::QFutureWatcherBase(QObject *parent = nullptr)
Constructs a watcher with the given parent.
QFutureWatcherBase::~QFutureWatcherBase()
Destroys the watcher.
void QFutureWatcherBase::cancel()
Cancels the watched future.
See also QFuture::cancel().
void QFutureWatcherBase::canceled()
This signal is emitted when the watched computation is canceled, or ends with an exception.
See also cancel() and finished().
bool QFutureWatcherBase::event(QEvent *event)
Reimplements QObject::event().
void QFutureWatcherBase::finished()
This signal is emitted when the watched computation has finished, after the signals for its results.
See also started() and canceled().
bool QFutureWatcherBase::isCanceled() const
Returns true if the watched computation was canceled.
See also cancel().
bool QFutureWatcherBase::isFinished() const
Returns true if the watched computation has finished.
See also finished().
bool QFutureWatcherBase::isPaused() const
Returns true if the watched computation is suspended or about to be.
See also isSuspending() and isSuspended().
bool QFutureWatcherBase::isRunning() const
Returns true if the watched computation is running.
See also isStarted().
bool QFutureWatcherBase::isStarted() const
Returns true if the watched computation has started. The state is the one of the future, not of the signals that were delivered.
See also started().
bool QFutureWatcherBase::isSuspended() const
Returns true if the watched computation is suspended.
See also isSuspending().
bool QFutureWatcherBase::isSuspending() const
Returns true if a suspension of the watched computation was requested and it has not acted on it.
See also isSuspended().
void QFutureWatcherBase::pause()
Suspends the watched computation. This is the same as suspend().
void QFutureWatcherBase::paused()
This signal is emitted when a suspension of the watched computation is requested. It is emitted together with suspending().
See also suspending(), suspended() and resumed().
int QFutureWatcherBase::progressMaximum() const
Returns the highest progress value of the watched future.
See also progressMinimum().
int QFutureWatcherBase::progressMinimum() const
Returns the lowest progress value of the watched future.
See also progressMaximum().
void QFutureWatcherBase::progressRangeChanged(int minimum, int maximum)
This signal is emitted when the range of the progress values changes to minimum to maximum.
See also progressValueChanged().
QString QFutureWatcherBase::progressText() const
Returns the progress text of the watched future.
See also progressValue().
void QFutureWatcherBase::progressTextChanged(const QString &progressText)
This signal is emitted when the progress text changes to progressText.
See also progressValueChanged().
int QFutureWatcherBase::progressValue() const
Returns the progress value of the watched future.
See also progressMinimum() and progressMaximum().
void QFutureWatcherBase::progressValueChanged(int progressValue)
This signal is emitted when the progress value changes to progressValue.
See also progressRangeChanged() and progressTextChanged().
void QFutureWatcherBase::resultReadyAt(int index)
This signal is emitted when the result at index is available. It is not emitted for results that arrive after the computation was canceled.
See also resultsReadyAt().
void QFutureWatcherBase::resultsReadyAt(int beginIndex, int endIndex)
This signal is emitted when the results from beginIndex up to, but not including, endIndex are available, after resultReadyAt() was emitted for each of them.
See also resultReadyAt().
void QFutureWatcherBase::resume()
Resumes the watched computation.
See also suspend().
void QFutureWatcherBase::resumed()
This signal is emitted when the watched computation is resumed after a suspension was requested.
See also suspending() and suspended().
void QFutureWatcherBase::setPaused(bool paused)
Suspends the watched computation if paused is true, and resumes it otherwise. This is the same as setSuspended().
void QFutureWatcherBase::setPendingResultsLimit(int limit)
Sets the number of results that may wait to be delivered to limit. The watched future is throttled while that many results are waiting, which QFutureInterfaceBase::isThrottled() reports to the computation. The default is 100 for each ideal thread.
See also QFutureInterfaceBase::setThrottled().
void QFutureWatcherBase::setSuspended(bool suspend)
Suspends the watched computation if suspend is true, and resumes it otherwise.
See also suspend() and resume().
void QFutureWatcherBase::started()
This signal is emitted, from the event loop of the thread the watcher lives in, when the watched computation starts.
See also finished().
void QFutureWatcherBase::suspend()
Asks the watched computation to suspend.
See also resume().
void QFutureWatcherBase::suspended()
This signal is emitted when the watched computation has acted on a suspension request.
See also suspending() and resumed().
void QFutureWatcherBase::suspending()
This signal is emitted when a suspension of the watched computation is requested.
See also suspended() and resumed().
void QFutureWatcherBase::togglePaused()
Suspends the watched computation if it is not suspended, and resumes it otherwise. This is the same as toggleSuspended().
void QFutureWatcherBase::toggleSuspended()
Suspends the watched computation if it is not suspended, and resumes it otherwise.
See also setSuspended().
void QFutureWatcherBase::waitForFinished()
Waits for the watched computation to finish. Signals for it are delivered by the event loop, not by this function. It throws the exception that the computation ended with, if any.
See also isFinished().