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

# KProgress Class Reference

A stylized progress bar. A progress indicator widget. More...

`#include <kprogress.h>`

Inheritance diagram for KProgress:

[legend]
Collaboration diagram for KProgress:

[legend]
List of all members.

## Public Slots
void | setFormat (const QString &format)
| Set the format of the text to use to display status.
void | setTotalSteps (int totalSteps)
| Set the current total number of steps in the action tat the progress bar is representing.
virtual void | setProgress (int progress)
| Set the current value of the progress bar to `value`.
void | setValue (int progress)
| This class or method is obsolete, it is provided for compatibility only..
virtual void | advance (int offset)
| Advance the progress bar by `prog`.
## Signals
void | percentageChanged (int)
| Emitted when the state of the progress bar changes.
## Public Member Functions
| KProgress (QWidget *parent=0, const char *name=0, WFlags f=0)
| Construct a progress bar.
| KProgress (int totalSteps, QWidget *parent=0, const char *name=0, WFlags f=0)
| Construct a progress bar with a total number of steps.
| ~KProgress ()
| Destruct the progress bar.
void | setTextEnabled (bool)
| If this is set to `true`, the progress text will be displayed.
int | value () const
| This class or method is obsolete, it is provided for compatibility only. Retrieves the current status, use progress() instead
bool | textEnabled () const
| Returns `true` if progress text will be displayed, `false` otherwise.
QString | format () const
| Retrieve the current format for printing status text.
void | setRange (int min, int max)
| This class or method is obsolete, it is provided for compatibility only. but kept for source compatibility with KDE2's KProgress.
int | maxValue ()
| This class or method is obsolete, it is provided for compatibility only. used totalSteps() instead
## Protected Member Functions
virtual bool | setIndicator (QString &indicator, int progress, int totalSteps)
virtual void | virtual_hook (int id, void *data)

## Detailed Description

A stylized progress bar. A progress indicator widget.

KProgress is derived from QProgressBar, so you can use all the methods from that class. The only real difference is that a signal is emitted on changes to the value and you do not need to subclass KProgress just to change the format of the indicator text.

Details

Author:
  Aaron Seigo

Version:
  Id
    kprogress.h,v 1.31 2002/05/21 16:55:30 tjansen Exp

Definition at line 46 of file kprogress.h.

## Constructor & Destructor Documentation

KProgress::KProgress | ( | QWidget * | parent = 0,
|  | const char * | name = 0,
|  | WFlags | f = 0
| ) |

| Construct a progress bar. Definition at line 40 of file kprogress.cpp. References KStdAccel::name(), and setProgress().

KProgress::KProgress | ( | int | totalSteps,
|  | QWidget * | parent = 0,
|  | const char * | name = 0,
|  | WFlags | f = 0
| ) |

| Construct a progress bar with a total number of steps. The totalSteps is the total number of steps that need to be completed for the operation which this progress bar represents. For example, if the operation is to examine 50 files, this value would be 50. Before examining the first file, call setProgress(0); call setProgress(50) after examining the last file. Definition at line 47 of file kprogress.cpp. References KStdAccel::name(), and setProgress().

KProgress::~KProgress | ( |  | ) |

| Destruct the progress bar. Definition at line 54 of file kprogress.cpp.

## Member Function Documentation

void KProgress::setTextEnabled | ( | bool |  | ) |

| If this is set to `true`, the progress text will be displayed. Definition at line 98 of file kprogress.cpp. References QProgressBar::setPercentageVisible().

int KProgress::value | ( |  | ) | const

| This class or method is obsolete, it is provided for compatibility only. Retrieves the current status, use progress() instead See also: setValue() Definition at line 118 of file kprogress.cpp. References QProgressBar::progress().

bool KProgress::textEnabled | ( |  | ) | const

| Returns `true` if progress text will be displayed, `false` otherwise. See also: setFormat() Definition at line 103 of file kprogress.cpp. References QProgressBar::percentageVisible().

QString KProgress::format | ( |  | ) | const

| Retrieve the current format for printing status text. See also: setFormat() Definition at line 113 of file kprogress.cpp.

void KProgress::setRange | ( | int | min,
|  | int | max
| ) |

| This class or method is obsolete, it is provided for compatibility only. but kept for source compatibility with KDE2's KProgress. Use setTotalSteps() instead Definition at line 88 of file kprogress.cpp. References setTotalSteps().

int KProgress::maxValue | ( |  | ) |

| This class or method is obsolete, it is provided for compatibility only. used totalSteps() instead Definition at line 93 of file kprogress.cpp. References QProgressBar::totalSteps().

void KProgress::setFormat | ( | const QString & | format | ) | `[slot]`

  | Set the format of the text to use to display status. The default format is "%p%" (which looks like "42%".) Parameters:
  format | p is replaced by percentage done, v is replaced by actual value, m is replaced by the maximum value.
Definition at line 108 of file kprogress.cpp.

void KProgress::setTotalSteps | ( | int | totalSteps | ) | `[slot]`

| Set the current total number of steps in the action tat the progress bar is representing. Reimplemented from QProgressBar. Definition at line 63 of file kprogress.cpp. References percentageChanged(), QProgressBar::progress(), and QProgressBar::setTotalSteps(). Referenced by setRange().

void KProgress::setProgress | ( | int | progress | ) | `[virtual, slot]`

| Set the current value of the progress bar to `value`. Reimplemented from QProgressBar. Definition at line 73 of file kprogress.cpp. References percentageChanged(), QProgressBar::setProgress(), and QProgressBar::totalSteps(). Referenced by advance(), KProgress(), and setValue().

void KProgress::setValue | ( | int | progress | ) | `[slot]`

| This class or method is obsolete, it is provided for compatibility only.. Use setProgress(int) instead Definition at line 83 of file kprogress.cpp. References setProgress().

void KProgress::advance | ( | int | offset | ) | `[virtual, slot]`

| Advance the progress bar by `prog`. This method is provided for convenience and is equivalent with setValue(value()+prog). Definition at line 58 of file kprogress.cpp. References QProgressBar::progress(), and setProgress().

void KProgress::percentageChanged | ( | int |  | ) | `[signal]`

| Emitted when the state of the progress bar changes. Referenced by setProgress(), and setTotalSteps().

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:01 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001