• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KProgressDialog Class Reference

#include <kprogressdialog.h>

Inheritance diagram for KProgressDialog:

Inheritance graph
[legend]

List of all members.


Detailed Description

A dialog with a progress bar.

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 QProgressBar is available through direct access to the progress bar widget via progressBar();

Author:
Aaron J. Seigo

Urs Wolfer uwolfer @ kde.org

Definition at line 45 of file kprogressdialog.h.


Public Member Functions

bool allowCancel () const
bool autoClose () const
bool autoReset () const
QString buttonText () const
void ignoreCancel ()
 KProgressDialog (QWidget *parent=0, const QString &caption=QString(), const QString &text=QString(), Qt::WFlags flags=0)
QString labelText () const
int minimumDuration () const
const QProgressBar * progressBar () const
QProgressBar * progressBar ()
virtual void reject ()
void setAllowCancel (bool allowCancel)
void setAutoClose (bool close)
void setAutoReset (bool autoReset)
void setButtonText (const QString &text)
void setLabelText (const QString &text)
void setMinimumDuration (int ms)
void showCancelButton (bool show)
bool wasCancelled () const
 ~KProgressDialog ()

Protected Member Functions

virtual void showEvent (QShowEvent *event)

Constructor & Destructor Documentation

KProgressDialog::KProgressDialog ( QWidget *  parent = 0,
const QString &  caption = QString(),
const QString &  text = QString(),
Qt::WFlags  flags = 0 
) [explicit]

Constructs a KProgressDialog.

Parameters:
parent Parent of the widget
caption Text to display in window title bar
text Text to display in the dialog
flags The widget flags

Definition at line 62 of file kprogressdialog.cpp.

KProgressDialog::~KProgressDialog (  ) 

Destructor.

Definition at line 93 of file kprogressdialog.cpp.


Member Function Documentation

bool KProgressDialog::allowCancel (  )  const

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

Definition at line 156 of file kprogressdialog.cpp.

bool KProgressDialog::autoClose (  )  const

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

Definition at line 186 of file kprogressdialog.cpp.

bool KProgressDialog::autoReset (  )  const

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

Definition at line 196 of file kprogressdialog.cpp.

QString KProgressDialog::buttonText (  )  const

Returns the text on the cancel button.

Definition at line 212 of file kprogressdialog.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?"

Definition at line 129 of file kprogressdialog.cpp.

QString KProgressDialog::labelText (  )  const

Returns the current dialog text.

Definition at line 176 of file kprogressdialog.cpp.

int KProgressDialog::minimumDuration (  )  const

Returns the wait duration in milliseconds.

Definition at line 145 of file kprogressdialog.cpp.

const QProgressBar * KProgressDialog::progressBar (  )  const

Returns the QProgressBar used in this dialog.

To set the number of steps or other progress bar related settings, access the QProgressBar object directly via this method.

Definition at line 166 of file kprogressdialog.cpp.

QProgressBar * KProgressDialog::progressBar (  ) 

Returns the QProgressBar used in this dialog.

To set the number of steps or other progress bar related settings, access the QProgressBar object directly via this method.

Definition at line 161 of file kprogressdialog.cpp.

void KProgressDialog::reject (  )  [virtual]

Reimplemented from QDialog.

Definition at line 114 of file kprogressdialog.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.

The default is true.

Parameters:
allowCancel Set to true to make the dialog non-closable

Definition at line 150 of file kprogressdialog.cpp.

void KProgressDialog::setAutoClose ( bool  close  ) 

Sets whether the dialog should close automagically when all the steps in the QProgressBar have been completed.

The default is true.

Definition at line 191 of file kprogressdialog.cpp.

void KProgressDialog::setAutoReset ( bool  autoReset  ) 

Sets whether the dialog should reset the QProgressBar dialog back to 0 steps compelete when all steps have been completed.

This is useful for KProgressDialogs that will be reused.

The default is false.

Definition at line 201 of file kprogressdialog.cpp.

void KProgressDialog::setButtonText ( const QString &  text  ) 

Sets the text to appear on the cancel button.

Definition at line 206 of file kprogressdialog.cpp.

void KProgressDialog::setLabelText ( const QString &  text  ) 

Sets the text in the dialog.

Parameters:
text the text to display

Definition at line 171 of file kprogressdialog.cpp.

void KProgressDialog::setMinimumDuration ( int  ms  ) 

Set the minimum number of milliseconds to wait before actually showing the dialog.

Definition at line 134 of file kprogressdialog.cpp.

void KProgressDialog::showCancelButton ( bool  show  ) 

Sets whether the cancel button is visible.

setAllowCancel(false) implies showCancelButton(false)

The default is true.

Parameters:
show Whether or not the cancel button should be shown

Definition at line 181 of file kprogressdialog.cpp.

void KProgressDialog::showEvent ( QShowEvent *  event  )  [protected, virtual]

Definition at line 108 of file kprogressdialog.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 124 of file kprogressdialog.cpp.


The documentation for this class was generated from the following files:
  • kprogressdialog.h
  • kprogressdialog.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal