Object that emits progress information of a (lengthy) operation. More...
#include <klfguiutil.h>
Public Slots | |
void | doReportProgress (int value) |
Signals | |
void | progress (int progressValue) |
void | finished () |
Public Member Functions | |
KLFProgressReporter (int min, int max, QObject *parent=NULL) | |
virtual | ~KLFProgressReporter () |
int | min () const |
int | max () const |
![]() | |
QObject (QObject *parent) | |
virtual | ~QObject () |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
virtual const QMetaObject * | metaObject () const |
QString | objectName () const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const |
bool | isWindowType () const |
bool | signalsBlocked () const |
bool | blockSignals (bool block) |
QThread * | thread () const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const |
const QObjectList & | children () const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
bool | disconnect (const QObject *receiver, const char *method) const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const |
QList< QByteArray > | dynamicPropertyNames () const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const |
bool | inherits (const char *className) const |
void | deleteLater () |
Additional Inherited Members | |
![]() | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
![]() | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
![]() | |
objectName | |
Object that emits progress information of a (lengthy) operation.
This object is intented to be used in two ways
To get informed, simple connect to the progress(int) signal, and possibly the finished() signal, to respectively get informed about how much progress is going on, and when the operation is finished. See the doc of those respective functions for more info.
To inform others about progress of an operation you're preforming, create a dedicated instance of KLFProgressReporter for that specific operation, inform others of the existance of such an object (to let them connect to progress()), then call doReportProgress() at regular intervals, making sure to call it the last time with the max() value.
Definition at line 63 of file klfguiutil.h.
KLFProgressReporter::KLFProgressReporter | ( | int | min, |
int | max, | ||
QObject * | parent = NULL |
||
) |
Definition at line 40 of file klfguiutil.cpp.
|
virtual |
Definition at line 47 of file klfguiutil.cpp.
References finished(), and progress().
|
slot |
The operations that perform long operations should regularly call this function. This function emits progress() with the given value.
Additionally, if value is max(), finished() is emitted. Do NOT call doReportProgress() any more after that, it will result in a warning.
Definition at line 55 of file klfguiutil.cpp.
References finished(), KLF_FUNC_NAME, and progress().
|
signal |
Emitted right after progress() was emitted with the max() value. If doReportProgress() is never called with the max() value, then this signal is emitted in the destructor.
Referenced by doReportProgress(), and ~KLFProgressReporter().
|
inline |
Definition at line 72 of file klfguiutil.h.
Referenced by KLFProgressReporter(), and KLFProgressDialog::startReportingProgress().
|
inline |
Definition at line 71 of file klfguiutil.h.
Referenced by KLFProgressReporter(), and KLFProgressDialog::startReportingProgress().
|
signal |
Emitted at regular intervals to inform connected slots about the progress of a given action.
This signal is emitted repeatedly with increasing progressValue
values ranging from min() to max().
The last time this signal is emitted for one operation, its progressValue
is exactly the max() value. (Progress reporters must enforce this).
Referenced by doReportProgress(), and ~KLFProgressReporter().