[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Slots | Signals | Public Member Functions | List of all members
KLFProgressReporter Class Reference

Object that emits progress information of a (lengthy) operation. More...

#include <klfguiutil.h>

Inheritance diagram for KLFProgressReporter:
Inheritance graph
[legend]
Collaboration diagram for KLFProgressReporter:
Collaboration graph
[legend]

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
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual ~QObject ()
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegExp &regExp, 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< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
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)
 
- Protected Member Functions inherited from QObject
QObjectsender () 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)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ KLFProgressReporter()

KLFProgressReporter::KLFProgressReporter ( int  min,
int  max,
QObject parent = NULL 
)

Definition at line 40 of file klfguiutil.cpp.

References max(), and min().

◆ ~KLFProgressReporter()

KLFProgressReporter::~KLFProgressReporter ( )
virtual
Note
emits finished() if hasn't done so already.

Definition at line 47 of file klfguiutil.cpp.

References finished(), and progress().

Member Function Documentation

◆ doReportProgress

void KLFProgressReporter::doReportProgress ( int  value)
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().

◆ finished

void KLFProgressReporter::finished ( )
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().

◆ max()

int KLFProgressReporter::max ( ) const
inline

Definition at line 72 of file klfguiutil.h.

Referenced by KLFProgressReporter(), and KLFProgressDialog::startReportingProgress().

◆ min()

int KLFProgressReporter::min ( ) const
inline

Definition at line 71 of file klfguiutil.h.

Referenced by KLFProgressReporter(), and KLFProgressDialog::startReportingProgress().

◆ progress

void KLFProgressReporter::progress ( int  progressValue)
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().


The documentation for this class was generated from the following files:

Generated by doxygen 1.8.13