|
Krita Source Code Documentation
|
#include <KoUpdater.h>
Inheritance diagram for KoUpdater:Public Slots | |
| void | setProgress (int percent) |
Signals | |
| void | sigCancel () |
| emitted whenever the subtask has called cancel on us | |
| void | sigHasValidRangeChanged (bool value) |
| void | sigNestedNameChanged (const QString &value) |
| void | sigProgress (int percent) |
| emitted whenever the subtask has called setProgress on us | |
Public Member Functions | |
| void | cancel () |
| bool | interrupted () const |
| int | maximum () const override |
| int | progress () const |
| void | setAutoNestedName (const QString &name) override |
| void | setFormat (const QString &format) override |
| void | setRange (int minimum, int maximum) override |
| void | setValue (int value) override |
| virtual | ~KoUpdater () |
Public Member Functions inherited from KoProgressProxy | |
| virtual | ~KoProgressProxy () |
Public Attributes | |
| QPointer< KoUpdaterPrivate > | d |
| int | max |
| int | min |
| int | range |
Protected Member Functions | |
| KoUpdater (KoUpdaterPrivate *_d) | |
Private Slots | |
| void | setInterrupted (bool value) |
Private Attributes | |
| QAtomicInt | m_interrupted |
| int | m_progressPercent |
Friends | |
| class | KoUpdaterPrivate |
An KoUpdater is a helper for keeping the progress of each subtask up to speed. This class is not thread safe, and it should only be used from one thread. The thread it is used in can be different from any other subtask or the KoProgressUpdater, though.
It is possible to create a KoProgressUpdater on a KoUpdater for when you need to recursively split up progress reporting. (For instance, when your progress reporting routine can be called by other progress reporting routines.)
KoUpdater implements KoProgressProxy because it is possible to recursively create another KoProgressUpdater with an updater as progress proxy.
Definition at line 36 of file KoUpdater.h.
|
virtual |
Definition at line 29 of file KoUpdater.cpp.
|
protected |
Definition at line 13 of file KoUpdater.cpp.
References cancel(), connect(), d, m_interrupted, setAutoNestedName(), setProgress(), setRange(), sigCancel(), sigHasValidRangeChanged(), sigNestedNameChanged(), and sigProgress().
| void KoUpdater::cancel | ( | ) |
Call this when this subtask wants to abort all the actions.
Definition at line 33 of file KoUpdater.cpp.
References sigCancel().
| bool KoUpdater::interrupted | ( | ) | const |
return true when this task should stop processing immediately. When the task has been cancelled all the subtasks will get interrupted and should stop working. It is therefore important to have repeated calls to this method at regular (time) intervals and as soon as the method returns true cancel the subtask.
Definition at line 54 of file KoUpdater.cpp.
References m_interrupted.
|
overridevirtual |
| int KoUpdater::progress | ( | ) | const |
return the progress this subtask has made.
Definition at line 48 of file KoUpdater.cpp.
References m_progressPercent.
|
overridevirtual |
Reimplemented from KoProgressProxy.
Definition at line 92 of file KoUpdater.cpp.
References sigNestedNameChanged().
|
overridevirtual |
Implements KoProgressProxy.
Definition at line 87 of file KoUpdater.cpp.
References sigNestedNameChanged().
|
privateslot |
|
slot |
Update your progress. Progress is always from 0 to 100. The global progress shown to the user is determined by the total amount of subtasks there are. This means that each subtasks can just report its own private progress in the range from 0 to 100.
Definition at line 38 of file KoUpdater.cpp.
References m_progressPercent, and sigProgress().
|
overridevirtual |
Implements KoProgressProxy.
Definition at line 79 of file KoUpdater.cpp.
References max, maximum(), min, range, and sigHasValidRangeChanged().
|
overridevirtual |
Implements KoProgressProxy.
Definition at line 64 of file KoUpdater.cpp.
References m_progressPercent, max, min, range, setProgress(), sigProgress(), and value().
|
signal |
emitted whenever the subtask has called cancel on us
|
signal |
|
signal |
|
signal |
emitted whenever the subtask has called setProgress on us
|
friend |
Definition at line 94 of file KoUpdater.h.
| QPointer<KoUpdaterPrivate> KoUpdater::d |
Definition at line 99 of file KoUpdater.h.
|
private |
Definition at line 110 of file KoUpdater.h.
|
private |
Definition at line 111 of file KoUpdater.h.
| int KoUpdater::max |
Definition at line 102 of file KoUpdater.h.
| int KoUpdater::min |
Definition at line 101 of file KoUpdater.h.
| int KoUpdater::range |
Definition at line 100 of file KoUpdater.h.