KProgressDialog class Reference (kdeui Library)

| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KProgressDialog Class Reference

KProgressDialog provides a dialog with a text label, a progress bar and an optional cancel button with a KDE look 'n feel. A dialog with a progress bar. More...

`#include <kprogress.h>`

Inheritance diagram for KProgressDialog:

[legend]
Collaboration diagram for KProgressDialog:

[legend]
List of all members.

## Public Member Functions
| KProgressDialog (QWidget *parent=0, const char *name=0, const QString &caption=QString::null, const QString &text=QString::null, bool modal=false)
| Constructs a KProgressDialog.
| ~KProgressDialog ()
| Desctructor.
KProgress * | progressBar ()
| Returns the KProgress used in this dialog.
void | setLabel (const QString &)
| Sets the text in the dialog.
QString | labelText ()
| Returns the current dialog text.
void | setAllowCancel (bool allowCancel)
| Sets whether or not the user can cancel the process.
bool | allowCancel ()
| Returns true if the dialog can be cancelled, false otherwise.
void | showCancelButton (bool show)
| Sets whether the cancel button is visible.
void | setAutoClose (bool close)
| Sets whether the dialog should close automagically when all the steps in the KProgress have been completed.
bool | autoClose ()
| Returns true if the dialog will close upon completion, or false otherwise.
void | setAutoReset (bool autoReset)
| Sets whether the dialog should reset the KProgress dialog back to 0 steps compelete when all steps have been completed.
bool | autoReset ()
| Returns true if the KProgress widget will be reset upon completion, or false otherwise.
bool | wasCancelled ()
| Returns true if the dialog was closed or cancelled before completion.
void | setButtonText (const QString &)
| Sets the text to appear on the cancel button.
QString | buttonText ()
| Returns the text on the cancel button.
void | setMinimumDuration (int ms)
| Set the minimum number of milliseconds to wait before actually showing the dialog.
int | minimumDuration ()
| Returns the wait duration in milliseconds.
## Protected Slots
void | slotAutoShow ()
void | slotAutoActions (int percentage)
void | slotCancel ()
| Activated when the Cancel button has been clicked.
## Protected Member Functions
virtual void | virtual_hook (int id, void *data)

## Detailed Description

KProgressDialog provides a dialog with a text label, a progress bar and an optional cancel button with a KDE look 'n feel. A dialog with a progress bar.

Since knowing how long it can take to complete an action and it is undesireable to show a dialog for a split second before hiding it, there are a few ways to control the timing behavior of KProgressDialog. There is a time out that can be set before showing the dialog as well as an option to autohide or keep displaying the dialog once complete.

All the functionality of KProgress is available through direct access to the progress bar widget via progressBar();

Author:
  Aaron J. Seigo

Definition at line 183 of file kprogress.h.

## Constructor & Destructor Documentation

KProgressDialog::KProgressDialog | ( | QWidget * | parent = 0,
|  | const char * | name = 0,
|  | const QString & | caption = QString::null,
|  | const QString & | text = QString::null,
|  | bool | modal = false
| ) |

  | Constructs a KProgressDialog. Parameters:
  parent | Parent of the widget
  name | Widget name
  caption | Text to display in window title bar
  text | Text to display in the dialog
  modal | Set to true to make the dialog modal
Definition at line 154 of file kprogress.cpp. References KDialogBase::actionButton(), KDialogBase::mainWidget(), KStdAccel::name(), KDialogBase::plainPage(), KWin::setIcons(), KDialogBase::showButton(), QTimer::start(), and QPushButton::text().

KProgressDialog::~KProgressDialog | ( |  | ) |

| Desctructor. Definition at line 187 of file kprogress.cpp.

## Member Function Documentation

KProgress * KProgressDialog::progressBar | ( |  | ) |

| Returns the KProgress used in this dialog. To set the number of steps or other progress bar related settings, access the KProgress object directly via this method. Definition at line 244 of file kprogress.cpp.

void KProgressDialog::setLabel | ( | const QString & |  | ) |

  | Sets the text in the dialog. Parameters:
  text | the text to display
Definition at line 249 of file kprogress.cpp. References QLabel::setText().

QString KProgressDialog::labelText | ( |  | ) |

| Returns the current dialog text. Definition at line 254 of file kprogress.cpp. References QLabel::text().

void KProgressDialog::setAllowCancel | ( | bool | allowCancel | ) |

  | Sets whether or not the user can cancel the process. If the dialog is cancellable, the Cancel button will be shown and the user can close the window using the window decorations. If the process is not (or should not be) interuptable, set the dialog to be modal and not cancellable. Parameters:
  allowCancel | Set to true to make the dialog non-closable
Definition at line 233 of file kprogress.cpp. References showCancelButton().

bool KProgressDialog::allowCancel | ( |  | ) |

| Returns true if the dialog can be cancelled, false otherwise. Definition at line 239 of file kprogress.cpp.

void KProgressDialog::showCancelButton | ( | bool | show | ) |

  | Sets whether the cancel button is visible. setAllowCancel(false) implies showCancelButton(false) Parameters:
  show | Whether or not the cancel button should be shown
Definition at line 259 of file kprogress.cpp. References KDialogBase::showButtonCancel(). Referenced by setAllowCancel().

void KProgressDialog::setAutoClose | ( | bool | close | ) |

| Sets whether the dialog should close automagically when all the steps in the KProgress have been completed. Definition at line 269 of file kprogress.cpp.

bool KProgressDialog::autoClose | ( |  | ) |

| Returns true if the dialog will close upon completion, or false otherwise. Definition at line 264 of file kprogress.cpp.

void KProgressDialog::setAutoReset | ( | bool | autoReset | ) |

| Sets whether the dialog should reset the KProgress dialog back to 0 steps compelete when all steps have been completed. This is useful for KProgressDialogs that will be reused. Definition at line 279 of file kprogress.cpp.

bool KProgressDialog::autoReset | ( |  | ) |

| Returns true if the KProgress widget will be reset upon completion, or false otherwise. Definition at line 274 of file kprogress.cpp.

bool KProgressDialog::wasCancelled | ( |  | ) |

| Returns true if the dialog was closed or cancelled before completion. If the dialog is not cancellable it will always return false. Definition at line 213 of file kprogress.cpp.

void KProgressDialog::setButtonText | ( | const QString & |  | ) |

| Sets the text to appear on the cancel button. Definition at line 284 of file kprogress.cpp. References KDialogBase::setButtonCancelText().

QString KProgressDialog::buttonText | ( |  | ) |

| Returns the text on the cancel button. Definition at line 290 of file kprogress.cpp.

void KProgressDialog::setMinimumDuration | ( | int | ms | ) |

| Set the minimum number of milliseconds to wait before actually showing the dialog. Definition at line 218 of file kprogress.cpp. References QTimer::start(), and QTimer::stop().

int KProgressDialog::minimumDuration | ( |  | ) |

| Returns the wait duration in milliseconds. Definition at line 228 of file kprogress.cpp.

void KProgressDialog::slotCancel | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Cancel button has been clicked. The QDialog::reject() is activated in regular mode and QDialog::done( Cancel ) when in message box mode. Reimplemented from KDialogBase. Definition at line 203 of file kprogress.cpp. References KDialogBase::slotCancel().

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

- kprogress.h
- kprogress.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:04:09 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001