.BI "virtual void \fBsetTotalSteps\fR ( int totalSteps )"
.br
.ti -1c
.BI "virtual void \fBsetProgress\fR ( int progress )"
.br
.ti -1c
.BI "void \fBsetProgress\fR ( int progress, int totalSteps )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "bool \fBcenterIndicator\fR - whether the indicator string should be centered"
.br
.ti -1c
.BI "bool \fBindicatorFollowsStyle\fR - whether the display of the indicator string should follow the GUI style"
.br
.ti -1c
.BI "bool \fBpercentageVisible\fR - whether the current progress value is displayed"
.br
.ti -1c
.BI "int \fBprogress\fR - the current amount of progress"
.br
.ti -1c
.BI "QString \fBprogressString\fR - the amount of progress as a string \fI(read " "only" ")\fR"
.br
.ti -1c
.BI "int \fBtotalSteps\fR - the total number of steps"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual bool \fBsetIndicator\fR ( QString & indicator, int progress, int totalSteps )"
.br
.in -1c
.SH DESCRIPTION
The QProgressBar widget provides a horizontal progress bar.
.PP
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.
.PP
The progress bar uses the concept of \fIsteps\fR; you give it the total number of steps and the number of steps completed so far and it will display the percentage of steps that have been completed. You can specify the total number of steps in the constructor or later with setTotalSteps(). The current number of steps is set with setProgress(). The progress bar can be rewound to the beginning with reset().
.PP
If the total is given as 0 the progress 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.
.PP
See also QProgressDialog, GUI Design Handbook: Progress Indicator, and Advanced Widgets.
.PP
.ce 1
.B "[Image Omitted]"
.PP
.ce 1
.B "[Image Omitted]"
.PP
See also QProgressDialog, GUI Design Handbook: Progress Indicator, and Advanced Widgets.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QProgressBar::QProgressBar ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
Constructs a progress bar.
.PP
The total number of steps is set to 100 by default.
.PP
The \fIparent\fR, \fIname\fR and widget flags, \fIf\fR, are passed on to the QFrame::QFrame() constructor.
.PP
See also totalSteps.
.SH "QProgressBar::QProgressBar ( int totalSteps, QWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
Constructs a progress bar.
.PP
The \fItotalSteps\fR 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.
.PP
The \fIparent\fR, \fIname\fR and widget flags, \fIf\fR, are passed to the QFrame::QFrame() constructor.
.PP
See also totalSteps and progress.
.SH "bool QProgressBar::centerIndicator () const"
Returns TRUE if the indicator string should be centered; otherwise returns FALSE. See the "centerIndicator" property for details.
Returns TRUE if the display of the indicator string should follow the GUI style; otherwise returns FALSE. See the "indicatorFollowsStyle" property for details.
Returns the amount of progress as a string. See the "progressString" property for details.
.SH "void QProgressBar::reset ()\fC [slot]\fR"
Reset the progress bar. The progress bar "rewinds" and shows no progress.
.PP
Examples:
.)l fileiconview/mainwindow.cpp and progressbar/progressbar.cpp.
.SH "void QProgressBar::setCenterIndicator ( bool on )"
Sets whether the indicator string should be centered to \fIon\fR. See the "centerIndicator" property for details.
.SH "bool QProgressBar::setIndicator ( QString & indicator, int progress, int totalSteps )\fC [virtual protected]\fR"
This method is called to generate the text displayed in the center (or in some styles, to the left) of the progress bar.
.PP
The \fIprogress\fR may be negative, indicating that the progress bar is in the "reset" state before any progress is set.
.PP
The default implementation is the percentage of completion or blank in the reset state. The percentage is calculated based on the \fIprogress\fR and \fItotalSteps\fR. You can set the \fIindicator\fR text if you wish.
.PP
To allow efficient repainting of the progress bar, this method should return FALSE if the string is unchanged from the last call to this function.