KProgressDialog Class Reference

`#include <kprogress.h>`

Inheritance diagram for KProgressDialog:

## Public Member Functions

| KProgressDialog (QWidget *parent=0, const char *name=0, const QString &caption=QString::null, const QString &text=QString::null, bool modal=false)
| ~KProgressDialog ()
KProgress * | progressBar ()
const KProgress * | progressBar () const
void | setLabel (const QString &text)
QString | labelText () KDE_DEPRECATED
QString | labelText () const
void | setAllowCancel (bool allowCancel)
bool | allowCancel () KDE_DEPRECATED
bool | allowCancel () const
void | showCancelButton (bool show)
void | setAutoClose (bool close)
bool | autoClose ()
bool | autoClose () const
void | setAutoReset (bool autoReset)
bool | autoReset ()
bool | autoReset () const
bool | wasCancelled ()
bool | wasCancelled () const
void | ignoreCancel ()
void | setButtonText (const QString &)
QString | buttonText () KDE_DEPRECATED
QString | buttonText () const
void | setMinimumDuration (int ms)
int | minimumDuration () KDE_DEPRECATED
int | minimumDuration () const
virtual void | show ()
Public Member Functions inherited from KDialogBase
| KDialogBase (QWidget *parent=0, const char *name=0, bool modal=true, const QString &caption=QString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
| KDialogBase (int dialogFace, const QString &caption, int buttonMask, ButtonCode defaultButton, QWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
| KDialogBase (KDialogBase::DialogType dialogFace, WFlags f, QWidget *parent=0, const char *name=0, bool modal=true, const QString &caption=QString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
| KDialogBase (const QString &caption, int buttonMask=Yes|No|Cancel, ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel, QWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &yes=KStdGuiItem::yes(), const KGuiItem &no=KStdGuiItem::no(), const KGuiItem &cancel=KStdGuiItem::cancel())
| ~KDialogBase ()
void | setButtonBoxOrientation (int orientation)
void | setEscapeButton (ButtonCode id)
virtual void | adjustSize ()
virtual QSize | sizeHint () const
virtual QSize | minimumSizeHint () const
QFrame * | plainPage ()
QFrame * | addPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QFrame * | addPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QVBox * | addVBoxPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QVBox * | addVBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QHBox * | addHBoxPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QHBox * | addHBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QGrid * | addGridPage (int n, Orientation dir, const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QGrid * | addGridPage (int n, Orientation dir, const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
void | setFolderIcon (const QStringList &path, const QPixmap &pixmap)
QFrame * | makeMainWidget ()
QVBox * | makeVBoxMainWidget ()
QHBox * | makeHBoxMainWidget ()
QGrid * | makeGridMainWidget (int n, Orientation dir)
void | enableButtonSeparator (bool state)
void | showButton (ButtonCode id, bool state)
void | showButtonOK (bool state)
void | showButtonApply (bool state)
void | showButtonCancel (bool state)
bool | showPage (int index)
int | activePageIndex () const
int | pageIndex (QWidget *widget) const
void | setMainWidget (QWidget *widget)
QWidget * | mainWidget ()
void | disableResize ()
void | setInitialSize (const QSize &s, bool noResize=false)
void | incInitialSize (const QSize &s, bool noResize=false)
QSize | configDialogSize (const QString &groupName) const
QSize | configDialogSize (KConfig &config, const QString &groupName) const
void | saveDialogSize (const QString &groupName, bool global=false)
void | saveDialogSize (KConfig &config, const QString &groupName, bool global=false) const
void | setButtonOK (const KGuiItem &item=KStdGuiItem::ok())
void | setButtonOKText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) KDE_DEPRECATED
void | setButtonApply (const KGuiItem &item=KStdGuiItem::apply())
void | setButtonApplyText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) KDE_DEPRECATED
void | setButtonCancel (const KGuiItem &item=KStdGuiItem::cancel())
void | setButtonCancelText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) KDE_DEPRECATED
void | setButtonText (ButtonCode id, const QString &text)
void | setButtonTip (ButtonCode id, const QString &text)
void | setButtonWhatsThis (ButtonCode id, const QString &text)
void | setButtonGuiItem (ButtonCode id, const KGuiItem &item)
void | setTreeListAutoResize (bool state)
void | setShowIconsInTreeList (bool state)
void | setRootIsDecorated (bool state)
void | unfoldTreeList (bool persist=false)
void | addWidgetBelowList (QWidget *widget)
void | addButtonBelowList (const QString &text, QObject *recv, const char *slot)
void | addButtonBelowList (const KGuiItem &guiitem, QObject *recv, const char *slot)
void | setIconListAllVisible (bool state)
void | showTile (bool state)
void | getBorderWidths (int &ulx, int &uly, int &lrx, int &lry) const KDE_DEPRECATED
QRect | getContentsRect () const KDE_DEPRECATED
QSize | calculateSize (int w, int h) const
QString | helpLinkText () const
QPushButton * | actionButton (ButtonCode id)
Public Member Functions inherited from KDialog
| KDialog (QWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0)

## Protected Slots

void | slotAutoShow ()
void | slotAutoActions (int percentage)
void | slotCancel ()
Protected Slots inherited from KDialogBase
virtual void | slotHelp ()
virtual void | slotDefault ()
virtual void | slotDetails ()
virtual void | slotUser3 ()
virtual void | slotUser2 ()
virtual void | slotUser1 ()
virtual void | slotOk ()
virtual void | slotApply ()
virtual void | slotTry ()
virtual void | slotYes ()
virtual void | slotNo ()
virtual void | slotCancel ()
virtual void | slotClose ()
virtual void | applyPressed ()
void | updateGeometry ()
void | slotDelayedDestruct ()

## Protected Member Functions

virtual void | virtual_hook (int id, void *data)
Protected Member Functions inherited from KDialogBase
virtual void | keyPressEvent (QKeyEvent *e)
virtual void | hideEvent (QHideEvent *)
virtual void | closeEvent (QCloseEvent *e)

## Additional Inherited Members

Public Types inherited from KDialogBase
enum | ButtonCode { Help = 0x00000001, Default = 0x00000002, Ok = 0x00000004, Apply = 0x00000008, Try = 0x00000010, Cancel = 0x00000020, Close = 0x00000040, User1 = 0x00000080, User2 = 0x00000100, User3 = 0x00000200, No = 0x00000080, Yes = 0x00000100, Details = 0x00000400, Filler = 0x40000000, Stretch = 0x80000000, NoDefault }
enum | ActionButtonStyle { ActionStyle0 =0, ActionStyle1, ActionStyle2, ActionStyle3, ActionStyle4, ActionStyleMAX }
enum | DialogType { TreeList = KJanusWidget::TreeList, Tabbed = KJanusWidget::Tabbed, Plain = KJanusWidget::Plain, Swallow = KJanusWidget::Swallow, IconList = KJanusWidget::IconList }
Public Slots inherited from KDialogBase
void | enableButton (ButtonCode id, bool state)
void | enableButtonOK (bool state)
void | enableButtonApply (bool state)
void | enableButtonCancel (bool state)
void | enableLinkedHelp (bool state)
void | delayedDestruct ()
void | setHelpLinkText (const QString &text)
void | setHelp (const QString &anchor, const QString &appname=QString::null)
void | helpClickedSlot (const QString &)
void | setDetails (bool showDetails)
void | setDetailsWidget (QWidget *detailsWidget)
void | updateBackground ()
void | cancel ()
Public Slots inherited from KDialog
virtual void | polish ()
virtual void | setCaption (const QString &caption)
virtual void | setPlainCaption (const QString &caption)
Signals inherited from KDialogBase
void | helpClicked ()
void | defaultClicked ()
void | user3Clicked ()
void | user2Clicked ()
void | user1Clicked ()
void | applyClicked ()
void | tryClicked ()
void | okClicked ()
void | yesClicked ()
void | noClicked ()
void | cancelClicked ()
void | closeClicked ()
void | apply ()
void | backgroundChanged ()
void | hidden ()
void | finished ()
void | aboutToShowDetails ()
void | aboutToShowPage (QWidget *page)
Signals inherited from KDialog
void | layoutHintChanged ()
Static Public Member Functions inherited from KDialogBase
static bool | haveBackgroundTile ()
static const QPixmap * | backgroundTile ()
static const QPixmap * | getBackgroundTile () KDE_DEPRECATED
static void | setBackgroundTile (const QPixmap *pix)
Static Public Member Functions inherited from KDialog
static int | marginHint ()
static int | spacingHint ()
static void | resizeLayout (QWidget *widget, int margin, int spacing)
static void | resizeLayout (QLayoutItem *lay, int margin, int spacing)
static void | centerOnScreen (QWidget *widget, int screen=-1)
static bool | avoidArea (QWidget *widget, const QRect &area, int screen=-1)

## Detailed Description

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

Since knowing how long it can take to complete an action and it is undesirable 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();

A dialog with a progress bar

Author
  Aaron J. Seigo

Definition at line 187 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 169 of file kprogress.cpp.

KProgressDialog::~KProgressDialog | ( |  | ) |

Destructor.

Definition at line 205 of file kprogress.cpp.

## Member Function Documentation

bool KProgressDialog::allowCancel | ( |  | ) |

Returns true if the dialog can be canceled, false otherwise.

Deprecated:

Definition at line 273 of file kprogress.cpp.

bool KProgressDialog::allowCancel | ( |  | ) | const

Returns true if the dialog can be canceled, false otherwise.

Definition at line 278 of file kprogress.cpp.

bool KProgressDialog::autoClose | ( |  | ) |

Returns true if the dialog will close upon completion, or false otherwise.

Definition at line 315 of file kprogress.cpp.

bool KProgressDialog::autoClose | ( |  | ) | const

Returns true if the dialog will close upon completion, or false otherwise.

Definition at line 320 of file kprogress.cpp.

bool KProgressDialog::autoReset | ( |  | ) |

Returns true if the KProgress widget will be reset upon completion, or false otherwise.

Definition at line 331 of file kprogress.cpp.

bool KProgressDialog::autoReset | ( |  | ) | const

Returns true if the KProgress widget will be reset upon completion, or false otherwise.

Definition at line 336 of file kprogress.cpp.

QString KProgressDialog::buttonText | ( |  | ) |

Returns the text on the cancel button.

Deprecated:

Definition at line 353 of file kprogress.cpp.

QString KProgressDialog::buttonText | ( |  | ) | const

Returns the text on the cancel button.

Definition at line 358 of file kprogress.cpp.

void KProgressDialog::ignoreCancel | ( |  | ) |

Ignores the last cancel action if the cancel button was pressed.

Useful for kdialog when combined with a KMessageBox to display a message like "Are you sure you want to cancel?"

Since
  3.5.5

Definition at line 236 of file kprogress.cpp.

QString KProgressDialog::labelText | ( |  | ) |

Returns the current dialog text.

Deprecated:

Definition at line 299 of file kprogress.cpp.

QString KProgressDialog::labelText | ( |  | ) | const

Returns the current dialog text.

Definition at line 304 of file kprogress.cpp.

int KProgressDialog::minimumDuration | ( |  | ) |

Returns the wait duration in milliseconds.

Deprecated:

Definition at line 256 of file kprogress.cpp.

int KProgressDialog::minimumDuration | ( |  | ) | const

Returns the wait duration in milliseconds.

Definition at line 261 of file kprogress.cpp.

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 283 of file kprogress.cpp.

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

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 288 of file kprogress.cpp.

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 266 of file kprogress.cpp.

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 325 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 341 of file kprogress.cpp.

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

Sets the text to appear on the cancel button.

Definition at line 346 of file kprogress.cpp.

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

Sets the text in the dialog.

Parameters

  text | the text to display

Definition at line 293 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 246 of file kprogress.cpp.

void KProgressDialog::show | ( | void |  | ) |

virtual

Reimplemented for internal reasons, the API is not affected.

Definition at line 401 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 309 of file kprogress.cpp.

bool KProgressDialog::wasCancelled | ( |  | ) |

Returns true if the dialog was closed or canceled before completion.

If the dialog is not cancellable it will always return false.

Definition at line 231 of file kprogress.cpp.

bool KProgressDialog::wasCancelled | ( |  | ) | const

Returns true if the dialog was closed or canceled before completion.

If the dialog is not cancellable it will always return false.

Definition at line 241 of file kprogress.cpp.

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

- kprogress.h
- kprogress.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys