A Progress Dialog. More...
#include <klfguiutil.h>
Public Slots | |
virtual void | setDescriptiveText (const QString &labelText) |
virtual void | startReportingProgress (KLFProgressReporter *progressReporter, const QString &descriptiveText) |
virtual void | startReportingProgress (KLFProgressReporter *progressReporter) |
virtual void | setValue (int value) |
Public Member Functions | |
KLFProgressDialog (QString labelText=QString(), QWidget *parent=NULL) | |
KLFProgressDialog (bool canCancel, QString labelText, QWidget *parent) | |
virtual | ~KLFProgressDialog () |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) |
A Progress Dialog.
This class is a QProgressDialog derivative that is optimized to work for klatexformula's needs, especially making it easy to use with KLFProgressReporter.
Among others, this dialog provides a straightforward option to disable the Cancel button.
Basically this is just a wrapper around QProgressDialog's functions. Typical use is:
The previous example is somewhat trivial and does not exhibit the advantages of the features of this class and of KLFProgressReporter over QProgressDialog; the example of KLFLibResourceEngine is more relevant:
which opens a progress dialog whenever the resource emits an operationStartReportingProgress()
signal. Note that in this example, we have not provided the means to delete the progress dialog once it has completed; for details have a look at the source code of klflibbrowser.cpp.
For yet another example of inline (on-the-stack) usage of KLFProgressDialog, check out KLFLibBrowser::slotExport() in klflibbrowser.cpp.
Definition at line 171 of file klfguiutil.h.
Build a progress dialog with the given labelText and parent
Definition at line 73 of file klfguiutil.cpp.
KLFProgressDialog::KLFProgressDialog | ( | bool | canCancel, |
QString | labelText, | ||
QWidget * | parent | ||
) |
Build a progress dialog with a cancel button that is enabled or disabled (following the value of canCancel
), with label labelText
, and parent parent
.
Definition at line 79 of file klfguiutil.cpp.
|
virtual |
Definition at line 85 of file klfguiutil.cpp.
|
protected |
Definition at line 146 of file klfguiutil.cpp.
References KLF_DEBUG_BLOCK, and KLF_FUNC_NAME.
|
virtualslot |
same as QProgressDialog::setLabelText() but resizes the dialog a bit larger so that its looks nicer.
Definition at line 107 of file klfguiutil.cpp.
|
virtualslot |
Calls directly QProgressDialog::setValue()
Definition at line 139 of file klfguiutil.cpp.
References klfDbg.
Referenced by startReportingProgress().
|
virtualslot |
start reporting progress from progressReporter
, without changing label text.
setValue()
Definition at line 127 of file klfguiutil.cpp.
References KLFProgressReporter::max(), KLFProgressReporter::min(), and setValue().
|
virtualslot |
start reporting progress from progressReporter
and set label text to descriptiveText
.
setValue()
Definition at line 112 of file klfguiutil.cpp.