1QProgressBar(3qt)                                            QProgressBar(3qt)
2
3
4

NAME

6       QProgressBar - Horizontal progress bar
7

SYNOPSIS

9       #include <qprogressbar.h>
10
11       Inherits QFrame.
12
13   Public Members
14       QProgressBar ( QWidget * parent = 0, const char * name = 0, WFlags f =
15           0 )
16       QProgressBar ( int totalSteps, QWidget * parent = 0, const char * name
17           = 0, WFlags f = 0 )
18       int totalSteps () const
19       int progress () const
20       const QString & progressString () const
21       void setCenterIndicator ( bool on )
22       bool centerIndicator () const
23       void setIndicatorFollowsStyle ( bool )
24       bool indicatorFollowsStyle () const
25       bool percentageVisible () const
26       void setPercentageVisible ( bool )
27
28   Public Slots
29       void reset ()
30       virtual void setTotalSteps ( int totalSteps )
31       virtual void setProgress ( int progress )
32       void setProgress ( int progress, int totalSteps )
33
34   Properties
35       bool centerIndicator - whether the indicator string should be centered
36       bool indicatorFollowsStyle - whether the display of the indicator
37           string should follow the GUI style
38       bool percentageVisible - whether the current progress value is
39           displayed
40       int progress - the current amount of progress
41       QString progressString - the amount of progress as a string  (read
42           only)
43       int totalSteps - the total number of steps
44
45   Protected Members
46       virtual bool setIndicator ( QString & indicator, int progress, int
47           totalSteps )
48

DESCRIPTION

50       The QProgressBar widget provides a horizontal progress bar.
51
52       A progress bar is used to give the user an indication of the progress
53       of an operation and to reassure them that the application is still
54       running.
55
56       The progress bar uses the concept of steps; you give it the total
57       number of steps and the number of steps completed so far and it will
58       display the percentage of steps that have been completed. You can
59       specify the total number of steps in the constructor or later with
60       setTotalSteps(). The current number of steps is set with setProgress().
61       The progress bar can be rewound to the beginning with reset().
62
63       If the total is given as 0 the progress bar shows a busy indicator
64       instead of a percentage of steps. This is useful, for example, when
65       using QFtp or QHttp to download items when they are unable to determine
66       the size of the item being downloaded.
67
68       See also QProgressDialog, GUI Design Handbook: Progress Indicator, and
69       Advanced Widgets.
70
71                                   [Image Omitted]
72
73                                   [Image Omitted]
74
75       See also QProgressDialog, GUI Design Handbook: Progress Indicator, and
76       Advanced Widgets.
77

MEMBER FUNCTION DOCUMENTATION

QProgressBar::QProgressBar ( QWidget * parent = 0, const char * name = 0,

80       WFlags f = 0 )
81       Constructs a progress bar.
82
83       The total number of steps is set to 100 by default.
84
85       The parent, name and widget flags, f, are passed on to the
86       QFrame::QFrame() constructor.
87
88       See also totalSteps.
89

QProgressBar::QProgressBar ( int totalSteps, QWidget * parent = 0, const char

91       * name = 0, WFlags f = 0 )
92       Constructs a progress bar.
93
94       The totalSteps is the total number of steps that need to be completed
95       for the operation which this progress bar represents. For example, if
96       the operation is to examine 50 files, this value would be 50. Before
97       examining the first file, call setProgress(0); call setProgress(50)
98       after examining the last file.
99
100       The parent, name and widget flags, f, are passed to the
101       QFrame::QFrame() constructor.
102
103       See also totalSteps and progress.
104

bool QProgressBar::centerIndicator () const

106       Returns TRUE if the indicator string should be centered; otherwise
107       returns FALSE. See the "centerIndicator" property for details.
108

bool QProgressBar::indicatorFollowsStyle () const

110       Returns TRUE if the display of the indicator string should follow the
111       GUI style; otherwise returns FALSE. See the "indicatorFollowsStyle"
112       property for details.
113

bool QProgressBar::percentageVisible () const

115       Returns TRUE if the current progress value is displayed; otherwise
116       returns FALSE. See the "percentageVisible" property for details.
117

int QProgressBar::progress () const

119       Returns the current amount of progress. See the "progress" property for
120       details.
121

const QString & QProgressBar::progressString () const

123       Returns the amount of progress as a string. See the "progressString"
124       property for details.
125

void QProgressBar::reset () [slot]

127       Reset the progress bar. The progress bar "rewinds" and shows no
128       progress.
129
130       Examples:
131

void QProgressBar::setCenterIndicator ( bool on )

133       Sets whether the indicator string should be centered to on. See the
134       "centerIndicator" property for details.
135

bool QProgressBar::setIndicator ( QString & indicator, int progress, int

137       totalSteps ) [virtual protected]
138       This method is called to generate the text displayed in the center (or
139       in some styles, to the left) of the progress bar.
140
141       The progress may be negative, indicating that the progress bar is in
142       the "reset" state before any progress is set.
143
144       The default implementation is the percentage of completion or blank in
145       the reset state. The percentage is calculated based on the progress and
146       totalSteps. You can set the indicator text if you wish.
147
148       To allow efficient repainting of the progress bar, this method should
149       return FALSE if the string is unchanged from the last call to this
150       function.
151

void QProgressBar::setIndicatorFollowsStyle ( bool )

153       Sets whether the display of the indicator string should follow the GUI
154       style. See the "indicatorFollowsStyle" property for details.
155

void QProgressBar::setPercentageVisible ( bool )

157       Sets whether the current progress value is displayed. See the
158       "percentageVisible" property for details.
159

void QProgressBar::setProgress ( int progress ) [virtual slot]

161       Sets the current amount of progress to progress. See the "progress"
162       property for details.
163

void QProgressBar::setProgress ( int progress, int totalSteps ) [slot]

165       This is an overloaded member function, provided for convenience. It
166       behaves essentially like the above function.
167
168       Sets the amount of progress to progress and the total number of steps
169       to totalSteps.
170
171       See also totalSteps.
172

void QProgressBar::setTotalSteps ( int totalSteps ) [virtual slot]

174       Sets the total number of steps to totalSteps. See the "totalSteps"
175       property for details.
176

int QProgressBar::totalSteps () const

178       Returns the total number of steps. See the "totalSteps" property for
179       details.
180
181   Property Documentation

bool centerIndicator

183       This property holds whether the indicator string should be centered.
184
185       Changing this property sets QProgressBar::indicatorFollowsStyle to
186       FALSE. The default is TRUE.
187
188       Set this property's value with setCenterIndicator() and get this
189       property's value with centerIndicator().
190

bool indicatorFollowsStyle

192       This property holds whether the display of the indicator string should
193       follow the GUI style.
194
195       The default is TRUE.
196
197       See also centerIndicator.
198
199       Set this property's value with setIndicatorFollowsStyle() and get this
200       property's value with indicatorFollowsStyle().
201

bool percentageVisible

203       This property holds whether the current progress value is displayed.
204
205       The default is TRUE.
206
207       See also centerIndicator and indicatorFollowsStyle.
208
209       Set this property's value with setPercentageVisible() and get this
210       property's value with percentageVisible().
211

int progress

213       This property holds the current amount of progress.
214
215       This property is -1 if progress counting has not started.
216
217       Set this property's value with setProgress() and get this property's
218       value with progress().
219

QString progressString

221       This property holds the amount of progress as a string.
222
223       This property is QString::null if progress counting has not started.
224
225       Get this property's value with progressString().
226

int totalSteps

228       This property holds the total number of steps.
229
230       If totalSteps is 0, the progress bar will display a busy indicator.
231
232       See also
233
234       Set this property's value with setTotalSteps() and get this property's
235       value with totalSteps().
236
237

SEE ALSO

239       http://doc.trolltech.com/qprogressbar.html
240       http://www.trolltech.com/faq/tech.html
241
243       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
244       license file included in the distribution for a complete license
245       statement.
246

AUTHOR

248       Generated automatically from the source code.
249

BUGS

251       If you find a bug in Qt, please report it as described in
252       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
253       help you. Thank you.
254
255       The definitive Qt documentation is provided in HTML format; it is
256       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
257       web browser. This man page is provided as a convenience for those users
258       who prefer man pages, although this format is not officially supported
259       by Trolltech.
260
261       If you find errors in this manual page, please report them to qt-
262       bugs@trolltech.com.  Please include the name of the manual page
263       (qprogressbar.3qt) and the Qt version (3.3.8).
264
265
266
267Trolltech AS                    2 February 2007              QProgressBar(3qt)
Impressum