You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqprogressbar.3qt

239 lines
9.7 KiB

'\" t
.TH QProgressBar 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QProgressBar \- Horizontal progress bar
.SH SYNOPSIS
\fC#include <ntqprogressbar.h>\fR
.PP
Inherits QFrame.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQProgressBar\fR ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
.br
.ti -1c
.BI "\fBQProgressBar\fR ( int totalSteps, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
.br
.ti -1c
.BI "int \fBtotalSteps\fR () const"
.br
.ti -1c
.BI "int \fBprogress\fR () const"
.br
.ti -1c
.BI "const TQString & \fBprogressString\fR () const"
.br
.ti -1c
.BI "void \fBsetCenterIndicator\fR ( bool on )"
.br
.ti -1c
.BI "bool \fBcenterIndicator\fR () const"
.br
.ti -1c
.BI "void \fBsetIndicatorFollowsStyle\fR ( bool )"
.br
.ti -1c
.BI "bool \fBindicatorFollowsStyle\fR () const"
.br
.ti -1c
.BI "bool \fBpercentageVisible\fR () const"
.br
.ti -1c
.BI "void \fBsetPercentageVisible\fR ( bool )"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBreset\fR ()"
.br
.ti -1c
.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 "TQString \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 ( TQString & 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 ( TQWidget * 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, TQWidget * 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.
.SH "bool QProgressBar::indicatorFollowsStyle () const"
Returns TRUE if the display of the indicator string should follow the GUI style; otherwise returns FALSE. See the "indicatorFollowsStyle" property for details.
.SH "bool QProgressBar::percentageVisible () const"
Returns TRUE if the current progress value is displayed; otherwise returns FALSE. See the "percentageVisible" property for details.
.SH "int QProgressBar::progress () const"
Returns the current amount of progress. See the "progress" property for details.
.SH "const TQString & QProgressBar::progressString () const"
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 ( TQString & 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.
.SH "void QProgressBar::setIndicatorFollowsStyle ( bool )"
Sets whether the display of the indicator string should follow the GUI style. See the "indicatorFollowsStyle" property for details.
.SH "void QProgressBar::setPercentageVisible ( bool )"
Sets whether the current progress value is displayed. See the "percentageVisible" property for details.
.SH "void QProgressBar::setProgress ( int progress )\fC [virtual slot]\fR"
Sets the current amount of progress to \fIprogress\fR. See the "progress" property for details.
.SH "void QProgressBar::setProgress ( int progress, int totalSteps )\fC [slot]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the amount of progress to \fIprogress\fR and the total number of steps to \fItotalSteps\fR.
.PP
See also totalSteps.
.SH "void QProgressBar::setTotalSteps ( int totalSteps )\fC [virtual slot]\fR"
Sets the total number of steps to \fItotalSteps\fR. See the "totalSteps" property for details.
.SH "int QProgressBar::totalSteps () const"
Returns the total number of steps. See the "totalSteps" property for details.
.SS "Property Documentation"
.SH "bool centerIndicator"
This property holds whether the indicator string should be centered.
.PP
Changing this property sets QProgressBar::indicatorFollowsStyle to FALSE. The default is TRUE.
.PP
Set this property's value with setCenterIndicator() and get this property's value with centerIndicator().
.SH "bool indicatorFollowsStyle"
This property holds whether the display of the indicator string should follow the GUI style.
.PP
The default is TRUE.
.PP
See also centerIndicator.
.PP
Set this property's value with setIndicatorFollowsStyle() and get this property's value with indicatorFollowsStyle().
.SH "bool percentageVisible"
This property holds whether the current progress value is displayed.
.PP
The default is TRUE.
.PP
See also centerIndicator and indicatorFollowsStyle.
.PP
Set this property's value with setPercentageVisible() and get this property's value with percentageVisible().
.SH "int progress"
This property holds the current amount of progress.
.PP
This property is -1 if progress counting has not started.
.PP
Set this property's value with setProgress() and get this property's value with progress().
.SH "TQString progressString"
This property holds the amount of progress as a string.
.PP
This property is TQString::null if progress counting has not started.
.PP
Get this property's value with progressString().
.SH "int totalSteps"
This property holds the total number of steps.
.PP
If totalSteps is 0, the progress bar will display a busy indicator.
.PP
See also
.PP
Set this property's value with setTotalSteps() and get this property's value with totalSteps().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqprogressbar.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqprogressbar.3qt) and the Qt
version (3.3.8).