QProgressBar(3qt)

NAME
QProgressBar - Horizontal progress bar

SYNOPSIS

#include <qprogressbar.h>

Inherits QFrame.

  Public Members
QProgressBar ( QWidget * parent=0, const char * name=0, WFlags f=0 )
QProgressBar ( int totalSteps, QWidget * parent=0, const char * name=0, WFlags f=0 )
int totalSteps () const
int progress () const
void setCenterIndicator ( bool on )
bool centerIndicator () const
void setIndicatorFollowsStyle ( bool )
bool indicatorFollowsStyle () const

  Public Slots
void reset ()
virtual void setTotalSteps ( int totalSteps )
virtual void setProgress ( int progress )

  Protected Members
virtual void drawContentsMask ( QPainter * )
virtual bool setIndicator ( QString & progress_str, int progress, int totalSteps )

  Properties
<table border=1 cellpadding=3 cellspacing=0> <tr><th>Type<th>Name<th>READ<th>WRITE<th>Options <tr><td>int<td>totalSteps<td>totalSteps<td>setTotalSteps<td>&nbsp; <tr><td>int<td>progress<td>progress<td>setProgress<td>&nbsp; <tr><td>bool<td>centerIndicator<td>centerIndicator<td>setCenterIndicator<td>&nbsp; <tr><td>bool<td>indicatorFollowsStyle<td>indicatorFollowsStyle<td>setIndicatorFollowsStyle<td>&nbsp; </table>

DESCRIPTION
The QProgressBar widget provides a horizontal progress bar.

A progress bar is used to give the user an indication of progress of an operation. To reassure them that the application has not crashed.

QProgressBar only implements the basic progress display, while QProgressDialog provides a fuller encapsulation.

<img src=qprogbar-m.png> <img src=qprogbar-w.png>

See also QProgressDialog and GUI Design Handbook: Progress Indicator

MEMBER FUNCTION DOCUMENTATION

QProgressBar::QProgressBar ( QWidget * parent=0, const char * name=0, WFlags f=0 )
Constructs a progress bar.

The total number of steps is set to 100 by default.

parent, name and f are sent to the QFrame::QFrame() constructor.

See also setTotalSteps().

QProgressBar::QProgressBar ( int totalSteps, QWidget * parent=0, const char * name=0, WFlags f=0 )
Constructs a progress bar.

totalSteps is the total number of steps in the operation of which this progress bar shows the progress. For example, if the operation is to examine 50 files, this value would be 50, then before examining the first file, call setProgress(0), and after examining the last file call setProgress(50).

parent, name and f are sent to the QFrame::QFrame() constructor.

See also setTotalSteps() and setProgress().

bool QProgressBar::centerIndicator () const
Returns where the indicator string should be displayed if indicatorFollowsStyle() is TRUE.

See also setCenterIndicator(), indicatorFollowsStyle(), setIndicatorFollowsStyle() and setIndicator().

void QProgressBar::drawContents ( QPainter * p ) [virtual protected]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QFrame.

void QProgressBar::drawContentsMask ( QPainter * p ) [virtual protected]
Draws the progressbar contents mask using the painter p. Used only in transparent mode.

See also QWidget::setAutoMask();.

Reimplemented from QFrame.

bool QProgressBar::indicatorFollowsStyle () const
Returns whether the display of the indicator string should follow the GUI style or not.

See also setIndicatorFollowsStyle(), setCenterIndicator(), centerIndicator() and setIndicator().

QSize QProgressBar::minimumSizeHint () const [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

int QProgressBar::progress () const
Returns the current amount of progress, or -1 if the progress counting has not started.

See also setProgress().

void QProgressBar::reset () [slot]
Reset the progress bar. The progress bar `rewinds'.

void QProgressBar::setCenterIndicator ( bool on )
If set to TRUE (the default) the progress bar always shows the indicator text at the center of the progress bar, regardless of the GUI style currently set. If set to FALSE the progress bar always shows the indicator text outside the progress bar, regardless of the GUI style currently set.

Calling this function always sets indicatorFollowsStyle() to FALSE.

See also centerIndicator(), indicatorFollowsStyle(), setIndicatorFollowsStyle() and setIndicator().

bool QProgressBar::setIndicator ( QString & indicator, int progress, int totalSteps ) [virtual protected]
This method is called to generate the text displayed in the center of the progress bar.

The progress may be negative, indicating that the bar is in the "reset" state before any progress is set.

The default implementation it is the percentage of completion or blank in the reset state.

This method should return FALSE if the string is unchanged since the last call to the method, to allow efficient repainting of the progress bar.

void QProgressBar::setIndicatorFollowsStyle ( bool on )
When set to TRUE (the default) the positioning of the indicator string follows the GUI style. When set to FALSE the indicator position is decided by the value of indicatorFollowsStyle().

See also indicatorFollowsStyle(), centerIndicator(), setCenterIndicator() and setIndicator().

void QProgressBar::setProgress ( int progress ) [virtual slot]
Sets the current amount of progress made to progress units of the total number of steps.

See also progress() and totalSteps().

void QProgressBar::setTotalSteps ( int totalSteps ) [virtual slot]
Sets the total number of steps to totalSteps.

See also totalSteps().

void QProgressBar::show () [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

QSize QProgressBar::sizeHint () const [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

QSizePolicy QProgressBar::sizePolicy () const [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

void QProgressBar::styleChange ( QStyle & old ) [virtual protected]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

int QProgressBar::totalSteps () const
Returns the total number of steps.

See also setTotalSteps().

SEE ALSO
http://doc.trolltech.com/qprogressbar.html

COPYRIGHT
Copyright 1992-2000 Trolltech AS, http://www.trolltech.com/. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.