|
Cute Chess
0.1
|
#include <worker.h>
Public Slots | |
| void | cancel () |
Signals | |
| void | cancelled () |
| void | error (int error) |
| void | finished () |
| void | progressChanged (int value) |
| void | started () |
| void | statusChanged (const QString &statusMessage) |
Public Member Functions | |
| void | run () override |
| QTime | startTime () const |
| QString | title () const |
| Worker (const QString &title) | |
| virtual | ~Worker () |
Protected Member Functions | |
| bool | cancelRequested () const |
| virtual void | work ()=0 |
An abstraction of a long-running task.
|
explicit |
|
virtual |
Destructs the Worker object.
|
slot |
Request cancellation of the worker.
After this slot has been called the worker should try to cancel its tasks as quickly as possible. The finished() signal is called after the cancellation is complete.
|
signal |
Emitted if the user requested to cancel the worker.
This signal is emitted automatically just before the finished() signal and should not manually emitted.
|
protected |
Returns true if the user requested cancellation of the task with the cancel() slot.
|
signal |
Signals that an error error has occured during the execution of the task. The meaning of error depends on the implementation.
|
signal |
Emitted after the worker has finished its tasks.
This signal is automatically emitted and should not manually emitted.
|
signal |
Emitted when the worker has made progress.
The value should be in the range 0 - 100.
|
signal |
Emitted after the worker has been started but before any tasks are performed.
This signal is emitted automatically should not manually emitted.
| QTime Worker::startTime | ( | ) | const |
Returns the time when the worker was started.
|
signal |
Emitted in when the status of the worker has changed.
The purpose of this signal is to give a textual description on what tasks are currently performed.
In case of an error this signal can be used to give a textual description of the error.
| QString Worker::title | ( | ) | const |
Returns the title of the worker.
|
protectedpure virtual |
Perform the long running task.
Periodically check for cancelRequested() to see if the work should be cancelled.
Optionally emit the progressChanged and statusChanged to reflect the current status of the work.
If any error occurs emit the error() and statusChanged() signals and return from the function.
Implemented in PgnImporter.
1.8.11