summaryrefslogtreecommitdiffstats
path: root/doc/html/qprogressdialog.html
blob: 604f4ff6c3892ac7d6f9a3758a77fb367cb4c7ec (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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/dialogs/qprogressdialog.cpp:99 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQProgressDialog Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQProgressDialog Class Reference</h1>

<p>The TQProgressDialog class provides feedback on the progress of a slow operation.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qprogressdialog-h.html">qprogressdialog.h</a>&gt;</tt>
<p>Inherits <a href="qdialog.html">TQDialog</a>.
<p><a href="qprogressdialog-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQProgressDialog"><b>TQProgressDialog</b></a> ( TQWidget&nbsp;*&nbsp;creator = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )</li>
<li class=fn><a href="#TQProgressDialog-2"><b>TQProgressDialog</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;labelText, const&nbsp;TQString&nbsp;&amp;&nbsp;cancelButtonText, int&nbsp;totalSteps, TQWidget&nbsp;*&nbsp;creator = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )</li>
<li class=fn><a href="#~TQProgressDialog"><b>~TQProgressDialog</b></a> ()</li>
<li class=fn>void <a href="#setLabel"><b>setLabel</b></a> ( TQLabel&nbsp;*&nbsp;label )</li>
<li class=fn>void <a href="#setCancelButton"><b>setCancelButton</b></a> ( TQPushButton&nbsp;*&nbsp;cancelButton )</li>
<li class=fn>void <a href="#setBar"><b>setBar</b></a> ( TQProgressBar&nbsp;*&nbsp;bar )</li>
<li class=fn>bool wasCancelled () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>bool <a href="#wasCanceled"><b>wasCanceled</b></a> () const</li>
<li class=fn>int <a href="#totalSteps"><b>totalSteps</b></a> () const</li>
<li class=fn>int <a href="#progress"><b>progress</b></a> () const</li>
<li class=fn>virtual TQSize <a href="#sizeHint"><b>sizeHint</b></a> () const</li>
<li class=fn>TQString <a href="#labelText"><b>labelText</b></a> () const</li>
<li class=fn>void <a href="#setAutoReset"><b>setAutoReset</b></a> ( bool&nbsp;b )</li>
<li class=fn>bool <a href="#autoReset"><b>autoReset</b></a> () const</li>
<li class=fn>void <a href="#setAutoClose"><b>setAutoClose</b></a> ( bool&nbsp;b )</li>
<li class=fn>bool <a href="#autoClose"><b>autoClose</b></a> () const</li>
<li class=fn>int <a href="#minimumDuration"><b>minimumDuration</b></a> () const</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>void <a href="#cancel"><b>cancel</b></a> ()</li>
<li class=fn>void <a href="#reset"><b>reset</b></a> ()</li>
<li class=fn>void <a href="#setTotalSteps"><b>setTotalSteps</b></a> ( int&nbsp;totalSteps )</li>
<li class=fn>void <a href="#setProgress"><b>setProgress</b></a> ( int&nbsp;progress )</li>
<li class=fn>void <a href="#setProgress-2"><b>setProgress</b></a> ( int&nbsp;progress, int&nbsp;totalSteps )</li>
<li class=fn>void <a href="#setLabelText"><b>setLabelText</b></a> ( const TQString &amp; )</li>
<li class=fn>void <a href="#setCancelButtonText"><b>setCancelButtonText</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;cancelButtonText )</li>
<li class=fn>void <a href="#setMinimumDuration"><b>setMinimumDuration</b></a> ( int&nbsp;ms )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void cancelled () &nbsp;<em>(obsolete)</em></li>
<li class=fn>void <a href="#canceled"><b>canceled</b></a> ()</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>bool <a href="#autoClose-prop"><b>autoClose</b></a>&nbsp;- whether the dialog gets hidden by reset()</li>
<li class=fn>bool <a href="#autoReset-prop"><b>autoReset</b></a>&nbsp;- whether the progress dialog calls reset() as soon as progress() equals totalSteps()</li>
<li class=fn>TQString <a href="#labelText-prop"><b>labelText</b></a>&nbsp;- the label's text</li>
<li class=fn>int <a href="#minimumDuration-prop"><b>minimumDuration</b></a>&nbsp;- the time that must pass before the dialog appears</li>
<li class=fn>int <a href="#progress-prop"><b>progress</b></a>&nbsp;- the current amount of progress made</li>
<li class=fn>int <a href="#totalSteps-prop"><b>totalSteps</b></a>&nbsp;- the total number of steps</li>
<li class=fn>bool <a href="#wasCanceled-prop"><b>wasCanceled</b></a>&nbsp;- whether the dialog was canceled &nbsp;<em>(read only)</em></li>
<li class=fn>bool wasCancelled&nbsp;- whether the dialog was canceled &nbsp;<em>(read only)</em> &nbsp;<em>(obsolete)</em></li>
</ul>
<h2>Protected Slots</h2>
<ul>
<li class=fn>void <a href="#forceShow"><b>forceShow</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQProgressDialog class provides feedback on the progress of a slow operation.


<p> A progress dialog is used to give the user an indication of how long
an operation is going to take, and to demonstrate that the
application has not frozen. It can also give the user an opportunity
to abort the operation.
<p> A common problem with progress dialogs is that it is difficult to know
when to use them; operations take different amounts of time on different
hardware.  TQProgressDialog offers a solution to this problem:
it estimates the time the operation will take (based on time for
steps), and only shows itself if that estimate is beyond <a href="#minimumDuration">minimumDuration</a>()
(4 seconds by default).
<p> Use <a href="#setTotalSteps">setTotalSteps</a>() (or the constructor) to set the number of
"steps" in the operation and call <a href="#setProgress">setProgress</a>() as the operation
progresses. The step value can be chosen arbitrarily. It can be the
number of files copied, the number of bytes received, the number of
iterations through the main loop of your algorithm, or some other
suitable unit.  Progress starts at 0, and the progress dialog shows
that the operation has finished when you call setProgress() with
<a href="#totalSteps">totalSteps</a>() as its argument.
<p> The dialog automatically resets and hides itself at the end of the
operation. Use <a href="#setAutoReset">setAutoReset</a>() and <a href="#setAutoClose">setAutoClose</a>() to change this
behavior.
<p> There are two ways of using TQProgressDialog: modal and modeless.
<p> Using a modal TQProgressDialog is simpler for the programmer, but you
must call <a href="qapplication.html#processEvents">TQApplication::processEvents</a>() or
<a href="qeventloop.html#processEvents">TQEventLoop::processEvents</a>(ExcludeUserInput) to keep the event loop
running to ensure that the application doesn't freeze. Do the
operation in a loop, call <a href="#setProgress">setProgress</a>() at intervals, and check
for cancellation with <a href="#wasCanceled">wasCanceled</a>(). For example:
<pre>
TQProgressDialog progress( "Copying files...", "Abort Copy", numFiles,
                          this, "progress", TRUE );
for ( int i = 0; i &lt; numFiles; i++ ) {
    progress.setProgress( i );
    qApp-&gt;<a href="qapplication.html#processEvents">processEvents</a>();

    if ( progress.wasCanceled() )
        break;
    //... copy one file
}
progress.setProgress( numFiles );
</pre>
 
<p> A modeless progress dialog is suitable for operations that take
place in the background, where the user is able to interact with the
application. Such operations are typically based on <a href="qtimer.html">TQTimer</a> (or
<a href="qobject.html#timerEvent">TQObject::timerEvent</a>()), <a href="qsocketnotifier.html">TQSocketNotifier</a>, or <a href="qurloperator.html">TQUrlOperator</a>; or performed
in a separate thread. A <a href="qprogressbar.html">TQProgressBar</a> in the status bar of your main window
is often an alternative to a modeless progress dialog.
<p> You need to have an event loop to be running, connect the
<a href="#canceled">canceled</a>() signal to a slot that stops the operation, and call <a href="#setProgress">setProgress</a>() at intervals. For example:
<pre>
Operation::Operation( <a href="qobject.html">TQObject</a> *parent = 0 )
    : <a href="qobject.html">TQObject</a>( parent ), steps( 0 )
{
    pd = new TQProgressDialog( "Operation in progress.", "Cancel", 100 );
    <a href="qobject.html#connect">connect</a>( pd, SIGNAL(<a href="#canceled">canceled</a>()), this, SLOT(<a href="#cancel">cancel</a>()) );
    t = new <a href="qtimer.html">TQTimer</a>( this );
    <a href="qobject.html#connect">connect</a>( t, SIGNAL(<a href="qtimer.html#timeout">timeout</a>()), this, SLOT(perform()) );
    t-&gt;<a href="qtimer.html#start">start</a>( 0 );
}

void Operation::perform()
{
    pd-&gt;<a href="#setProgress">setProgress</a>( steps );
    //... perform one percent of the operation
    steps++;
    if ( steps &gt; pd-&gt;<a href="#totalSteps">totalSteps</a>() )
        t-&gt;<a href="qtimer.html#stop">stop</a>();
}

void Operation::cancel()
{
    t-&gt;<a href="qtimer.html#stop">stop</a>();
    //... cleanup
}
</pre>
 
<p> In both modes the progress dialog may be customized by
replacing the child widgets with custom widgets by using <a href="#setLabel">setLabel</a>(),
<a href="#setBar">setBar</a>(), and <a href="#setCancelButton">setCancelButton</a>().
The functions <a href="#setLabelText">setLabelText</a>() and <a href="#setCancelButtonText">setCancelButtonText</a>()
set the texts shown.
<p> <img src=qprogdlg-m.png> <img src=qprogdlg-w.png>
<p> <p>See also <a href="qdialog.html">TQDialog</a>, <a href="qprogressbar.html">TQProgressBar</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Progress Indicator</a>, and <a href="dialogs.html">Dialog Classes</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQProgressDialog"></a>TQProgressDialog::TQProgressDialog ( <a href="qwidget.html">TQWidget</a>&nbsp;*&nbsp;creator = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )
</h3>
Constructs a progress dialog.
<p> Default settings:
<ul>
<li> The label text is empty.
<li> The cancel button text is (translated) "Cancel".
<li> The total number of steps is 100.
</ul>
<p> The <em>creator</em> argument is the widget to use as the dialog's parent.
The <em>name</em>, <em>modal</em>, and the widget flags, <em>f</em>, are
passed to the <a href="qdialog.html#TQDialog">TQDialog::TQDialog</a>() constructor. If <em>modal</em> is FALSE (the
default), you must have an event loop proceeding for any redrawing
of the dialog to occur. If <em>modal</em> is TRUE, the dialog ensures that
events are processed when needed.
<p> <p>See also <a href="#labelText-prop">labelText</a>, <a href="#setLabel">setLabel</a>(), <a href="#setCancelButtonText">setCancelButtonText</a>(), <a href="#setCancelButton">setCancelButton</a>(), and <a href="#totalSteps-prop">totalSteps</a>.

<h3 class=fn><a name="TQProgressDialog-2"></a>TQProgressDialog::TQProgressDialog ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;labelText, const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;cancelButtonText, int&nbsp;totalSteps, <a href="qwidget.html">TQWidget</a>&nbsp;*&nbsp;creator = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )
</h3>
Constructs a progress dialog.
<p> The <em>labelText</em> is text used to remind the user what is progressing.
<p> The <em>cancelButtonText</em> is the text to display on the cancel button,
or 0 if no cancel button is to be shown.
<p> The <em>totalSteps</em> is the total number of steps in the operation for
which this progress dialog shows progress.  For example, if the
operation is to examine 50 files, this value would be 50. Before
examining the first file, call <a href="#setProgress">setProgress</a>(0). As each file is
processed call setProgress(1), setProgress(2), etc., finally
calling setProgress(50) after examining the last file.
<p> The <em>creator</em> argument is the widget to use as the dialog's parent.
The <em>name</em>, <em>modal</em>, and widget flags, <em>f</em>, are passed to the
<a href="qdialog.html#TQDialog">TQDialog::TQDialog</a>() constructor. If <em>modal</em> is FALSE (the default),
you will must have an event loop proceeding for any redrawing of
the dialog to occur. If <em>modal</em> is TRUE, the dialog ensures that
events are processed when needed.
<p> <p>See also <a href="#labelText-prop">labelText</a>, <a href="#setLabel">setLabel</a>(), <a href="#setCancelButtonText">setCancelButtonText</a>(), <a href="#setCancelButton">setCancelButton</a>(), and <a href="#totalSteps-prop">totalSteps</a>.

<h3 class=fn><a name="~TQProgressDialog"></a>TQProgressDialog::~TQProgressDialog ()
</h3>
Destroys the progress dialog.

<h3 class=fn>bool <a name="autoClose"></a>TQProgressDialog::autoClose () const
</h3><p>Returns TRUE if the dialog gets hidden by <a href="#reset">reset</a>(); otherwise returns FALSE.
See the <a href="qprogressdialog.html#autoClose-prop">"autoClose"</a> property for details.
<h3 class=fn>bool <a name="autoReset"></a>TQProgressDialog::autoReset () const
</h3><p>Returns TRUE if the progress dialog calls <a href="#reset">reset</a>() as soon as <a href="#progress">progress</a>() equals <a href="#totalSteps">totalSteps</a>(); otherwise returns FALSE.
See the <a href="qprogressdialog.html#autoReset-prop">"autoReset"</a> property for details.
<h3 class=fn>void <a name="cancel"></a>TQProgressDialog::cancel ()<tt> [slot]</tt>
</h3>
Resets the progress dialog. <a href="#wasCanceled">wasCanceled</a>() becomes TRUE until
the progress dialog is reset.
The progress dialog becomes hidden.

<h3 class=fn>void <a name="canceled"></a>TQProgressDialog::canceled ()<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the cancel button is clicked.
It is connected to the <a href="#cancel">cancel</a>() slot by default.
<p> <p>See also <a href="#wasCanceled-prop">wasCanceled</a>.

<h3 class=fn>void <a name="cancelled"></a>TQProgressDialog::cancelled ()<tt> [signal]</tt>
</h3>

<p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Use <a href="#canceled">canceled</a>() instead.

<p>Examples: <a href="ftpclient-example.html#x768">network/ftpclient/ftpmainwindow.ui.h</a> and <a href="progress-example.html#x82">progress/progress.cpp</a>.
<h3 class=fn>void <a name="forceShow"></a>TQProgressDialog::forceShow ()<tt> [protected slot]</tt>
</h3>
Shows the dialog if it is still hidden after the algorithm has been started
and minimumDuration milliseconds have passed.
<p> <p>See also <a href="#minimumDuration-prop">minimumDuration</a>.

<h3 class=fn><a href="qstring.html">TQString</a> <a name="labelText"></a>TQProgressDialog::labelText () const
</h3><p>Returns the label's text.
See the <a href="qprogressdialog.html#labelText-prop">"labelText"</a> property for details.
<h3 class=fn>int <a name="minimumDuration"></a>TQProgressDialog::minimumDuration () const
</h3><p>Returns the time that must pass before the dialog appears.
See the <a href="qprogressdialog.html#minimumDuration-prop">"minimumDuration"</a> property for details.
<h3 class=fn>int <a name="progress"></a>TQProgressDialog::progress () const
</h3><p>Returns the current amount of progress made.
See the <a href="qprogressdialog.html#progress-prop">"progress"</a> property for details.
<h3 class=fn>void <a name="reset"></a>TQProgressDialog::reset ()<tt> [slot]</tt>
</h3>
Resets the progress dialog.
The progress dialog becomes hidden if <a href="#autoClose">autoClose</a>() is TRUE.
<p> <p>See also <a href="#autoClose-prop">autoClose</a> and <a href="#autoReset-prop">autoReset</a>.

<p>Example: <a href="ftpclient-example.html#x769">network/ftpclient/ftpmainwindow.ui.h</a>.
<h3 class=fn>void <a name="setAutoClose"></a>TQProgressDialog::setAutoClose ( bool&nbsp;b )
</h3><p>Sets whether the dialog gets hidden by <a href="#reset">reset</a>() to <em>b</em>.
See the <a href="qprogressdialog.html#autoClose-prop">"autoClose"</a> property for details.
<h3 class=fn>void <a name="setAutoReset"></a>TQProgressDialog::setAutoReset ( bool&nbsp;b )
</h3><p>Sets whether the progress dialog calls <a href="#reset">reset</a>() as soon as <a href="#progress">progress</a>() equals <a href="#totalSteps">totalSteps</a>() to <em>b</em>.
See the <a href="qprogressdialog.html#autoReset-prop">"autoReset"</a> property for details.
<h3 class=fn>void <a name="setBar"></a>TQProgressDialog::setBar ( <a href="qprogressbar.html">TQProgressBar</a>&nbsp;*&nbsp;bar )
</h3>
Sets the progress bar widget to <em>bar</em>. The progress dialog resizes to
fit. The progress dialog takes ownership of the progress <em>bar</em> which
will be deleted when necessary, so do not use a progress bar
allocated on the stack.

<h3 class=fn>void <a name="setCancelButton"></a>TQProgressDialog::setCancelButton ( <a href="qpushbutton.html">TQPushButton</a>&nbsp;*&nbsp;cancelButton )
</h3>
Sets the cancel button to the push button, <em>cancelButton</em>. The
progress dialog takes ownership of this button which will be deleted
when necessary, so do not pass the address of an object that is on
the stack, i.e. use new() to create the button.
<p> <p>See also <a href="#setCancelButtonText">setCancelButtonText</a>().

<h3 class=fn>void <a name="setCancelButtonText"></a>TQProgressDialog::setCancelButtonText ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;cancelButtonText )<tt> [slot]</tt>
</h3>
Sets the cancel button's text to <em>cancelButtonText</em>.
<p>See also <a href="#setCancelButton">setCancelButton</a>().

<h3 class=fn>void <a name="setLabel"></a>TQProgressDialog::setLabel ( <a href="qlabel.html">TQLabel</a>&nbsp;*&nbsp;label )
</h3>
Sets the label to <em>label</em>. The progress dialog resizes to fit. The
label becomes owned by the progress dialog and will be deleted when
necessary, so do not pass the address of an object on the stack.
<p> <p>See also <a href="#labelText-prop">labelText</a>.

<p>Example: <a href="progress-example.html#x83">progress/progress.cpp</a>.
<h3 class=fn>void <a name="setLabelText"></a>TQProgressDialog::setLabelText ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp; )<tt> [slot]</tt>
</h3><p>Sets the label's text.
See the <a href="qprogressdialog.html#labelText-prop">"labelText"</a> property for details.
<h3 class=fn>void <a name="setMinimumDuration"></a>TQProgressDialog::setMinimumDuration ( int&nbsp;ms )<tt> [slot]</tt>
</h3><p>Sets the time that must pass before the dialog appears to <em>ms</em>.
See the <a href="qprogressdialog.html#minimumDuration-prop">"minimumDuration"</a> property for details.
<h3 class=fn>void <a name="setProgress"></a>TQProgressDialog::setProgress ( int&nbsp;progress )<tt> [slot]</tt>
</h3><p>Sets the current amount of progress made to <em>progress</em>.
See the <a href="qprogressdialog.html#progress-prop">"progress"</a> property for details.
<h3 class=fn>void <a name="setProgress-2"></a>TQProgressDialog::setProgress ( int&nbsp;progress, int&nbsp;totalSteps )<tt> [slot]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the current amount of progress to <em>progress</em> and the total number of
steps to <em>totalSteps</em>.
<p> <p>See also <a href="#totalSteps-prop">totalSteps</a>.

<h3 class=fn>void <a name="setTotalSteps"></a>TQProgressDialog::setTotalSteps ( int&nbsp;totalSteps )<tt> [slot]</tt>
</h3><p>Sets the total number of steps to <em>totalSteps</em>.
See the <a href="qprogressdialog.html#totalSteps-prop">"totalSteps"</a> property for details.
<h3 class=fn><a href="qsize.html">TQSize</a> <a name="sizeHint"></a>TQProgressDialog::sizeHint () const<tt> [virtual]</tt>
</h3>
Returns a size that fits the contents of the progress dialog.
The progress dialog resizes itself as retquired, so you should not
need to call this yourself.

<h3 class=fn>int <a name="totalSteps"></a>TQProgressDialog::totalSteps () const
</h3><p>Returns the total number of steps.
See the <a href="qprogressdialog.html#totalSteps-prop">"totalSteps"</a> property for details.
<h3 class=fn>bool <a name="wasCanceled"></a>TQProgressDialog::wasCanceled () const
</h3><p>Returns TRUE if the dialog was canceled; otherwise returns FALSE.
See the <a href="qprogressdialog.html#wasCanceled-prop">"wasCanceled"</a> property for details.
<h3 class=fn>bool <a name="wasCancelled"></a>TQProgressDialog::wasCancelled () const
</h3><p>Returns TRUE if the dialog was canceled; otherwise returns FALSE.
See the <a href="qprogressdialog.html#wasCancelled-prop">"wasCancelled"</a> property for details.
<hr><h2>Property Documentation</h2>
<h3 class=fn>bool <a name="autoClose-prop"></a>autoClose</h3>
<p>This property holds whether the dialog gets hidden by <a href="#reset">reset</a>().
<p>The default is TRUE.
<p> <p>See also <a href="#autoReset-prop">autoReset</a>.

<p>Set this property's value with <a href="#setAutoClose">setAutoClose</a>() and get this property's value with <a href="#autoClose">autoClose</a>().
<h3 class=fn>bool <a name="autoReset-prop"></a>autoReset</h3>
<p>This property holds whether the progress dialog calls <a href="#reset">reset</a>() as soon as <a href="#progress">progress</a>() equals <a href="#totalSteps">totalSteps</a>().
<p>The default is TRUE.
<p> <p>See also <a href="#autoClose-prop">autoClose</a>.

<p>Set this property's value with <a href="#setAutoReset">setAutoReset</a>() and get this property's value with <a href="#autoReset">autoReset</a>().
<h3 class=fn><a href="qstring.html">TQString</a> <a name="labelText-prop"></a>labelText</h3>
<p>This property holds the label's text.
<p>The default text is <a href="qstring.html#TQString-null">TQString::null</a>.

<p>Set this property's value with <a href="#setLabelText">setLabelText</a>() and get this property's value with <a href="#labelText">labelText</a>().
<h3 class=fn>int <a name="minimumDuration-prop"></a>minimumDuration</h3>
<p>This property holds the time that must pass before the dialog appears.
<p>If the expected duration of the task is less than the
minimumDuration, the dialog will not appear at all. This prevents
the dialog popping up for tasks that are tquickly over. For tasks
that are expected to exceed the minimumDuration, the dialog will
pop up after the minimumDuration time or as soon as any progress
is set.
<p> If set to 0, the dialog is always shown as soon as any progress is
set. The default is 4000 milliseconds.

<p>Set this property's value with <a href="#setMinimumDuration">setMinimumDuration</a>() and get this property's value with <a href="#minimumDuration">minimumDuration</a>().
<h3 class=fn>int <a name="progress-prop"></a>progress</h3>
<p>This property holds the current amount of progress made.
<p>For the progress dialog to work as expected, you should initially set
this property to 0 and finally set it to
<a href="#totalSteps">TQProgressDialog::totalSteps</a>(); you can call <a href="#setProgress">setProgress</a>() any number of times
in-between.
<p> <b>Warning:</b> If the progress dialog is modal
(see <a href="#TQProgressDialog">TQProgressDialog::TQProgressDialog</a>()),
this function calls <a href="qapplication.html#processEvents">TQApplication::processEvents</a>(), so take care that
this does not cause undesirable re-entrancy in your code. For example,
don't use a TQProgressDialog inside a <a href="qwidget.html#paintEvent">paintEvent</a>()!
<p> <p>See also <a href="#totalSteps-prop">totalSteps</a>.

<p>Set this property's value with <a href="#setProgress">setProgress</a>() and get this property's value with <a href="#progress">progress</a>().
<h3 class=fn>int <a name="totalSteps-prop"></a>totalSteps</h3>
<p>This property holds the total number of steps.
<p>The default is 0.

<p>Set this property's value with <a href="#setTotalSteps">setTotalSteps</a>() and get this property's value with <a href="#totalSteps">totalSteps</a>().
<h3 class=fn>bool <a name="wasCanceled-prop"></a>wasCanceled</h3>
<p>This property holds whether the dialog was canceled.
<p>Get this property's value with <a href="#wasCanceled">wasCanceled</a>().
<p><p>See also <a href="#progress-prop">progress</a>.

<h3 class=fn>bool <a name="wasCancelled-prop"></a>wasCancelled</h3>
<p>This property holds whether the dialog was canceled.
<p><b>This property is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Use <a href="#wasCanceled-prop">wasCanceled</a> instead.

<p>Get this property's value with <a href="#wasCancelled">wasCancelled</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>