summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqprogressbar.3qt
blob: 2d51550e0abe26a431ed69fd7d7c6e053fb7f555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
'\" 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 TQFtp or TQHttp 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).