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 172 of file klfguiutil.h.
Build a progress dialog with the given labelText and parent
Definition at line 74 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 80 of file klfguiutil.cpp.
|
virtual |
Definition at line 86 of file klfguiutil.cpp.
References setDescriptiveText().
|
protected |
Definition at line 147 of file klfguiutil.cpp.
References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and Qt::WindowFlags.
|
virtualslot |
same as QProgressDialog::setLabelText() but resizes the dialog a bit larger so that its looks nicer.
Definition at line 108 of file klfguiutil.cpp.
Referenced by startReportingProgress(), and ~KLFProgressDialog().
|
virtualslot |
Calls directly QProgressDialog::setValue()
Definition at line 140 of file klfguiutil.cpp.
References klfDbg.
Referenced by startReportingProgress().
|
virtualslot |
start reporting progress from progressReporter
and set label text to descriptiveText
.
setValue()
Definition at line 113 of file klfguiutil.cpp.
References KLFProgressReporter::max(), KLFProgressReporter::min(), setDescriptiveText(), and setValue().
|
virtualslot |
start reporting progress from progressReporter
, without changing label text.
setValue()
Definition at line 128 of file klfguiutil.cpp.
References KLFProgressReporter::max(), KLFProgressReporter::min(), and setValue().