Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QProgressBar Class Reference

The QProgressBar widget provides a horizontal progress bar. More...

    #include <QProgressBar>

Inherits QWidget.

- List of all members, including inherited members

### Writable Properties

- alignment : Qt::Alignment
- maximum : int
- minimum : int

- textVisible : bool
- value : int

- 33 writable properties inherited from QWidget
- 1 writable property inherited from QObject

### Read-Only Properties

- text : QString

- 20 read-only properties inherited from QWidget

### Public Functions

- QProgressBar ( QWidget * parent = 0 )
- void setRange ( int minimum, int maximum )

- 92 public functions inherited from QWidget
- 26 public functions inherited from QObject
- 10 public functions inherited from QPaintDevice

### Public Slots

- void reset ()
- void setValue ( int value )

- 16 public slots inherited from QWidget
- 1 public slot inherited from QObject

### Signals

- void valueChanged ( int value )

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QWidget
- 4 static public members inherited from QObject

### Protected Functions

- 42 protected functions inherited from QWidget
- 7 protected functions inherited from QObject

## Detailed Description

The QProgressBar widget provides a horizontal progress bar.

A progress bar is used to give the user an indication of the progress of an operation and to reassure them that the application is still running.

The progress bar uses the concept of steps. You set it up by specifying the minumum and maximum possible step values, and it will display the percentage of steps that have been completed when you later give it the current step value.

You can specify the minimum and maximum number of steps with setMinimum() and setMaximum. The current number of steps is set with setValue(). The progress bar can be rewound to the beginning with reset().

If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using QFtp or QHttp to download items when they are unable to determine the size of the item being downloaded.

GUI Design Handbook: Progress Indicator

See also QProgressDialog and QProgressDialog.

## Property Documentation

### alignment : Qt::Alignment

Access functions:

- Qt::Alignment alignment () const
- void setAlignment ( Qt::Alignment alignment )

### maximum : int

Access functions:

- int maximum () const
- void setMaximum ( int maximum )

### minimum : int

Access functions:

- int minimum () const
- void setMinimum ( int minimum )

### text : QString

Access functions:

- virtual QString text () const

### textVisible : bool

Access functions:

- bool isTextVisible () const
- void setTextVisible ( bool visible )

### value : int

This property holds the progressbar's current value.

Attemting to change the current value to one outside the minimum-maximum range has no effect the current value.

Access functions:

- int value () const
- void setValue ( int value )

## Member Function Documentation

### QProgressBar::QProgressBar ( QWidget * parent = 0 )

Constructs a progress bar.

By default, the minimum step value is set to 0, and the maximum to 100.

The parent, ais passed on to the QWidget::QWidget() constructor.

See also setTotalSteps().

### void QProgressBar::reset () `[slot]`

Reset the progress bar. The progress bar "rewinds" and shows no progress.

### void QProgressBar::setRange ( int minimum, int maximum )

Sets the progressbar's minimum to min and its maximum to max.

If max is smaller than min, min becomes the only legal value.

If the current value falls outside the new range, the progressbar is reset with reset().

See also minimum and maximum.

### void QProgressBar::valueChanged ( int value ) `[signal]`