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 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
  
     | 
    
      <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- q3progressdialog.cpp -->
  <title>Qt 4.8: Q3ProgressDialog Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li>Qt3SupportLight</li>
<li>Q3ProgressDialog</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#protected-slots">Protected Slots</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">Q3ProgressDialog Class Reference</h1>
<!-- $$$Q3ProgressDialog-brief -->
<p>The Q3ProgressDialog class provides feedback on the progress of a slow operation. <a href="#details">More...</a></p>
<!-- @@@Q3ProgressDialog -->
<pre class="cpp"> <span class="preprocessor">#include <Q3ProgressDialog></span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qprogressdialog">Porting to Qt 4</a> for more information.</p>
<p><b>Inherits: </b><a href="qdialog.html">QDialog</a>.</p>
<ul>
<li><a href="q3progressdialog-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="q3progressdialog.html#autoClose-prop">autoClose</a></b> : bool</li>
<li class="fn"><b><a href="q3progressdialog.html#autoReset-prop">autoReset</a></b> : bool</li>
<li class="fn"><b><a href="q3progressdialog.html#labelText-prop">labelText</a></b> : QString</li>
<li class="fn"><b><a href="q3progressdialog.html#minimumDuration-prop">minimumDuration</a></b> : int</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="q3progressdialog.html#progress-prop">progress</a></b> : int</li>
<li class="fn"><b><a href="q3progressdialog.html#totalSteps-prop">totalSteps</a></b> : int</li>
<li class="fn"><b><a href="q3progressdialog.html#wasCanceled-prop">wasCanceled</a></b> : const bool</li>
<li class="fn"><b><a href="q3progressdialog.html#wasCancelled-prop">wasCancelled</a></b> : const bool</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">2 properties inherited from <a href="qdialog.html#properties">QDialog</a></li>
<li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#Q3ProgressDialog">Q3ProgressDialog</a></b> ( QWidget * <i>creator</i>, const char * <i>name</i>, bool <i>modal</i> = false, Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#Q3ProgressDialog-2">Q3ProgressDialog</a></b> ( const QString & <i>labelText</i>, const QString & <i>cancelButtonText</i>, int <i>totalSteps</i>, QWidget * <i>creator</i> = 0, const char * <i>name</i> = 0, bool <i>modal</i> = false, Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#Q3ProgressDialog-3">Q3ProgressDialog</a></b> ( QWidget * <i>creator</i> = 0, Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#Q3ProgressDialog-4">Q3ProgressDialog</a></b> ( const QString & <i>labelText</i>, const QString & <i>cancelButtonText</i>, int <i>totalSteps</i>, QWidget * <i>creator</i> = 0, Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#dtor.Q3ProgressDialog">~Q3ProgressDialog</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#autoClose-prop">autoClose</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#autoReset-prop">autoReset</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#labelText-prop">labelText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#minimumDuration-prop">minimumDuration</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#progress-prop">progress</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#autoClose-prop">setAutoClose</a></b> ( bool <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#autoReset-prop">setAutoReset</a></b> ( bool <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#setBar">setBar</a></b> ( Q3ProgressBar * <i>bar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#setCancelButton">setCancelButton</a></b> ( QPushButton * <i>cancelButton</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#setLabel">setLabel</a></b> ( QLabel * <i>label</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#totalSteps-prop">totalSteps</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#wasCanceled-prop">wasCanceled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#wasCancelled-prop">wasCancelled</a></b> () const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#sizeHint">sizeHint</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">8 public functions inherited from <a href="qdialog.html#public-functions">QDialog</a></li>
<li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#cancel">cancel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#reset">reset</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#setCancelButtonText">setCancelButtonText</a></b> ( const QString & <i>cancelButtonText</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#labelText-prop">setLabelText</a></b> ( const QString & )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#minimumDuration-prop">setMinimumDuration</a></b> ( int <i>ms</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#progress-prop">setProgress</a></b> ( int <i>progress</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#progress-prop">setProgress</a></b> ( int <i>progress</i>, int <i>totalSteps</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#totalSteps-prop">setTotalSteps</a></b> ( int <i>totalSteps</i> )</td></tr>
</table>
<ul>
<li class="fn">5 public slots inherited from <a href="qdialog.html#public-slots">QDialog</a></li>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#canceled">canceled</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#cancelled">cancelled</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">3 signals inherited from <a href="qdialog.html#signals">QDialog</a></li>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#changeEvent">changeEvent</a></b> ( QEvent * <i>ev</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#closeEvent">closeEvent</a></b> ( QCloseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#resizeEvent">resizeEvent</a></b> ( QResizeEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#showEvent">showEvent</a></b> ( QShowEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li class="fn">7 protected functions inherited from <a href="qdialog.html#protected-functions">QDialog</a></li>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<a name="protected-slots"></a>
<h2>Protected Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3progressdialog.html#forceShow">forceShow</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">7 protected functions inherited from <a href="qdialog.html#protected-functions">QDialog</a></li>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<!-- $$$Q3ProgressDialog-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The Q3ProgressDialog class provides feedback on the progress of a slow operation.</p>
<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>
<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. Q3ProgressDialog 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="q3progressdialog.html#minimumDuration-prop">minimumDuration</a>() (4 seconds by default).</p>
<p>Use <a href="q3progressdialog.html#totalSteps-prop">setTotalSteps</a>() (or the constructor) to set the number of "steps" in the operation and call <a href="q3progressdialog.html#progress-prop">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 <a href="q3progressdialog.html#progress-prop">setProgress</a>() with <a href="q3progressdialog.html#totalSteps-prop">totalSteps</a>() as its argument.</p>
<p>The dialog automatically resets and hides itself at the end of the operation. Use <a href="q3progressdialog.html#autoReset-prop">setAutoReset</a>() and <a href="q3progressdialog.html#autoClose-prop">setAutoClose</a>() to change this behavior.</p>
<p>There are two ways of using Q3ProgressDialog: modal and modeless.</p>
<p>Using a modal Q3ProgressDialog is simpler for the programmer, but you must call <a href="qcoreapplication.html#processEvents">QApplication::processEvents</a>() or QEventLoop::processEvents(ExcludeUserInput) to keep the event loop running to ensure that the application doesn't freeze. Do the operation in a loop, call <a href="q3progressdialog.html#progress-prop">setProgress</a>() at intervals, and check for cancellation with <a href="q3progressdialog.html#wasCanceled-prop">wasCanceled</a>(). For example:</p>
<pre class="cpp"> <span class="type">Q3ProgressDialog</span> <a href="q3progressdialog.html#progress-prop">progress</a>(<span class="string">"Copying files..."</span><span class="operator">,</span> <span class="string">"Abort Copy"</span><span class="operator">,</span> numFiles<span class="operator">,</span>
                           <span class="keyword">this</span><span class="operator">,</span> <span class="string">"progress"</span><span class="operator">,</span> <span class="keyword">true</span>);
 <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> numFiles; i<span class="operator">+</span><span class="operator">+</span>) {
     progress<span class="operator">.</span>setProgress(i);
     qApp<span class="operator">-</span><span class="operator">></span>processEvents();
     <span class="keyword">if</span> (progress<span class="operator">.</span>wasCanceled())
         <span class="keyword">break</span>;
     <span class="comment">//... copy one file</span>
 }
 progress<span class="operator">.</span><a href="q3progressdialog.html#progress-prop">setProgress</a>(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">QTimer</a> (or <a href="qobject.html#timerEvent">QObject::timerEvent</a>()), <a href="qsocketnotifier.html">QSocketNotifier</a>, or <a href="porting4.html#qurloperator">QUrlOperator</a>; or performed in a separate thread. A <a href="q3progressbar.html">Q3ProgressBar</a> in the status bar of your main window is often an alternative to a modeless progress dialog.</p>
<p>You need to have an event loop to be running, connect the <a href="q3progressdialog.html#canceled">canceled</a>() signal to a slot that stops the operation, and call <a href="q3progressdialog.html#progress-prop">setProgress</a>() at intervals. For example:</p>
<pre class="cpp"> Operation<span class="operator">::</span>Operation(<span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>)
     : <span class="type"><a href="qobject.html">QObject</a></span>(parent)<span class="operator">,</span> steps(<span class="number">0</span>)
 {
     pd <span class="operator">=</span> <span class="keyword">new</span> <span class="type">Q3ProgressDialog</span>(<span class="string">"Operation in progress."</span><span class="operator">,</span> <span class="string">"Cancel"</span><span class="operator">,</span> <span class="number">100</span>);
     connect(pd<span class="operator">,</span> SIGNAL(canceled())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(cancel()));
     t <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qtimer.html">QTimer</a></span>(<span class="keyword">this</span>);
     connect(t<span class="operator">,</span> SIGNAL(timeout())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(perform()));
     t<span class="operator">-</span><span class="operator">></span>start(<span class="number">0</span>);
 }
 <span class="type">void</span> Operation<span class="operator">::</span>perform()
 {
     pd<span class="operator">-</span><span class="operator">></span>setProgress(steps);
     <span class="comment">//... perform one percent of the operation</span>
     steps<span class="operator">+</span><span class="operator">+</span>;
     <span class="keyword">if</span> (steps <span class="operator">></span> pd<span class="operator">-</span><span class="operator">></span>totalSteps())
         t<span class="operator">-</span><span class="operator">></span>stop();
 }
 <span class="type">void</span> Operation<span class="operator">::</span><a href="q3progressdialog.html#cancel">cancel</a>()
 {
     t<span class="operator">-</span><span class="operator">></span>stop();
     <span class="comment">//... cleanup</span>
 }</pre>
<p>In both modes the progress dialog may be customized by replacing the child widgets with custom widgets by using <a href="q3progressdialog.html#setLabel">setLabel</a>(), <a href="q3progressdialog.html#setBar">setBar</a>(), and <a href="q3progressdialog.html#setCancelButton">setCancelButton</a>(). The functions <a href="q3progressdialog.html#labelText-prop">setLabelText</a>() and <a href="q3progressdialog.html#setCancelButtonText">setCancelButtonText</a>() set the texts shown.</p>
<p><img src="images/qprogdlg-m.png" alt="Screenshot in Motif style" /> <img src="images/qprogdlg-w.png" alt="Screenshot in Windows style" /></p>
</div>
<p><b>See also </b><a href="qdialog.html">QDialog</a>, <a href="q3progressbar.html">Q3ProgressBar</a>, and <a href="guibooks.html#fowler">GUI Design Handbook: Progress Indicator</a>.</p>
<!-- @@@Q3ProgressDialog -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoClose-prop$$$autoClose$$$setAutoClosebool -->
<h3 class="fn"><a name="autoClose-prop"></a><span class="name">autoClose</span> : <span class="type">bool</span></h3>
<p>This property holds whether the dialog gets hidden by reset().</p>
<p>The default is true.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>autoClose</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoClose</b></span> ( bool <i>b</i> )</td></tr>
</table>
<p><b>See also </b><a href="q3progressdialog.html#autoReset-prop">setAutoReset</a>().</p>
<!-- @@@autoClose -->
<!-- $$$autoReset-prop$$$autoReset$$$setAutoResetbool -->
<h3 class="fn"><a name="autoReset-prop"></a><span class="name">autoReset</span> : <span class="type">bool</span></h3>
<p>This property holds whether the progress dialog calls reset() as soon as progress() equals totalSteps().</p>
<p>The default is true.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>autoReset</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoReset</b></span> ( bool <i>b</i> )</td></tr>
</table>
<p><b>See also </b><a href="q3progressdialog.html#autoClose-prop">setAutoClose</a>().</p>
<!-- @@@autoReset -->
<!-- $$$labelText-prop$$$labelText$$$setLabelTextconstQString& -->
<h3 class="fn"><a name="labelText-prop"></a><span class="name">labelText</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the label's text.</p>
<p>The default text is an empty string.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>labelText</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLabelText</b></span> ( const QString & )</td></tr>
</table>
<!-- @@@labelText -->
<!-- $$$minimumDuration-prop$$$minimumDuration$$$setMinimumDurationint -->
<h3 class="fn"><a name="minimumDuration-prop"></a><span class="name">minimumDuration</span> : <span class="type">int</span></h3>
<p>This property holds the time that must pass before the dialog appears.</p>
<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 quickly 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>
<p>If set to 0, the dialog is always shown as soon as any progress is set. The default is 4000 milliseconds.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>minimumDuration</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMinimumDuration</b></span> ( int <i>ms</i> )</td></tr>
</table>
<!-- @@@minimumDuration -->
<!-- $$$progress-prop$$$progress$$$setProgressint$$$setProgressintint -->
<h3 class="fn"><a name="progress-prop"></a><span class="name">progress</span> : <span class="type">int</span></h3>
<p>This property holds the current amount of progress made.</p>
<p>For the progress dialog to work as expected, you should initially set this property to 0 and finally set it to <a href="q3progressdialog.html#totalSteps-prop">Q3ProgressDialog::totalSteps</a>(); you can call setProgress() any number of times in-between.</p>
<p><b>Warning:</b> If the progress dialog is modal (see <a href="q3progressdialog.html#Q3ProgressDialog">Q3ProgressDialog::Q3ProgressDialog</a>()), this function calls <a href="qcoreapplication.html#processEvents">QApplication::processEvents</a>(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a <a href="q3progressdialog.html" class="compat">Q3ProgressDialog</a> inside a <a href="qwidget.html#paintEvent">paintEvent</a>()!</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>progress</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setProgress</b></span> ( int <i>progress</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setProgress</b></span> ( int <i>progress</i>, int <i>totalSteps</i> )</td></tr>
</table>
<p><b>See also </b><a href="q3progressdialog.html#totalSteps-prop">totalSteps</a>.</p>
<!-- @@@progress -->
<!-- $$$totalSteps-prop$$$totalSteps$$$setTotalStepsint -->
<h3 class="fn"><a name="totalSteps-prop"></a><span class="name">totalSteps</span> : <span class="type">int</span></h3>
<p>This property holds the total number of steps.</p>
<p>The default is 0.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>totalSteps</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTotalSteps</b></span> ( int <i>totalSteps</i> )</td></tr>
</table>
<!-- @@@totalSteps -->
<!-- $$$wasCanceled-prop$$$wasCanceled -->
<h3 class="fn"><a name="wasCanceled-prop"></a><span class="name">wasCanceled</span> : const <span class="type">bool</span></h3>
<p>This property holds whether the dialog was canceled.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>wasCanceled</b></span> () const</td></tr>
</table>
<p><b>See also </b><a href="q3progressdialog.html#progress-prop">setProgress</a>().</p>
<!-- @@@wasCanceled -->
<!-- $$$wasCancelled-prop$$$wasCancelled -->
<h3 class="fn"><a name="wasCancelled-prop"></a><span class="name">wasCancelled</span> : const <span class="type">bool</span></h3>
<p>This property holds whether the dialog was canceled.</p>
<p>Use <a href="q3progressdialog.html#wasCanceled-prop">wasCanceled</a> instead.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>wasCancelled</b></span> () const</td></tr>
</table>
<!-- @@@wasCancelled -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3ProgressDialog[overload1]$$$Q3ProgressDialogQWidget*constchar*boolQt::WindowFlags -->
<h3 class="fn"><a name="Q3ProgressDialog"></a>Q3ProgressDialog::<span class="name">Q3ProgressDialog</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>creator</i>, const <span class="type">char</span> * <i>name</i>, <span class="type">bool</span> <i>modal</i> = false, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = 0 )</h3>
<p>Constructs a progress dialog.</p>
<p>Default settings:</p>
<ul>
<li>The label text is empty.</li>
<li>The cancel button text is (translated) "Cancel".</li>
<li>The total number of steps is 100.</li>
</ul>
<p>The <i>creator</i> argument is the widget to use as the dialog's parent. The <i>name</i>, <i>modal</i>, and the widget flags, <i>f</i>, are passed to the <a href="qdialog.html#QDialog">QDialog::QDialog</a>() constructor. If <i>modal</i> is false (the default), you must have an event loop proceeding for any redrawing of the dialog to occur. If <i>modal</i> is true, the dialog ensures that events are processed when needed.</p>
<p><b>See also </b><a href="q3progressdialog.html#labelText-prop">setLabelText</a>(), <a href="q3progressdialog.html#setLabel">setLabel</a>(), <a href="q3progressdialog.html#setCancelButtonText">setCancelButtonText</a>(), <a href="q3progressdialog.html#setCancelButton">setCancelButton</a>(), and <a href="q3progressdialog.html#totalSteps-prop">setTotalSteps</a>().</p>
<!-- @@@Q3ProgressDialog -->
<!-- $$$Q3ProgressDialog$$$Q3ProgressDialogconstQString&constQString&intQWidget*constchar*boolQt::WindowFlags -->
<h3 class="fn"><a name="Q3ProgressDialog-2"></a>Q3ProgressDialog::<span class="name">Q3ProgressDialog</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>labelText</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>cancelButtonText</i>, <span class="type">int</span> <i>totalSteps</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>creator</i> = 0, const <span class="type">char</span> * <i>name</i> = 0, <span class="type">bool</span> <i>modal</i> = false, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = 0 )</h3>
<p>Constructs a progress dialog.</p>
<p>The <i>labelText</i> is text used to remind the user what is progressing.</p>
<p>The <i>cancelButtonText</i> is the text to display on the cancel button, or 0 if no cancel button is to be shown.</p>
<p>The <i>totalSteps</i> 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 setProgress(0). As each file is processed call setProgress(1), setProgress(2), etc., finally calling setProgress(50) after examining the last file.</p>
<p>The <i>creator</i> argument is the widget to use as the dialog's parent. The <i>name</i>, <i>modal</i>, and widget flags, <i>f</i>, are passed to the <a href="qdialog.html#QDialog">QDialog::QDialog</a>() constructor. If <i>modal</i> is false (the default), you will must have an event loop proceeding for any redrawing of the dialog to occur. If <i>modal</i> is true, the dialog ensures that events are processed when needed.</p>
<p><b>See also </b><a href="q3progressdialog.html#labelText-prop">setLabelText</a>(), <a href="q3progressdialog.html#setLabel">setLabel</a>(), <a href="q3progressdialog.html#setCancelButtonText">setCancelButtonText</a>(), <a href="q3progressdialog.html#setCancelButton">setCancelButton</a>(), and <a href="q3progressdialog.html#totalSteps-prop">setTotalSteps</a>().</p>
<!-- @@@Q3ProgressDialog -->
<!-- $$$Q3ProgressDialog$$$Q3ProgressDialogQWidget*Qt::WindowFlags -->
<h3 class="fn"><a name="Q3ProgressDialog-3"></a>Q3ProgressDialog::<span class="name">Q3ProgressDialog</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>creator</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = 0 )</h3>
<p>Constructs a progress dialog.</p>
<p>Default settings:</p>
<ul>
<li>The label text is empty.</li>
<li>The cancel button text is (translated) "Cancel".</li>
<li>The total number of steps is 100.</li>
</ul>
<p>The <i>creator</i> argument is the widget to use as the dialog's parent. The widget flags, <i>f</i>, are passed to the <a href="qdialog.html#QDialog">QDialog::QDialog</a>() constructor.</p>
<p><b>See also </b><a href="q3progressdialog.html#labelText-prop">setLabelText</a>(), <a href="q3progressdialog.html#setLabel">setLabel</a>(), <a href="q3progressdialog.html#setCancelButtonText">setCancelButtonText</a>(), <a href="q3progressdialog.html#setCancelButton">setCancelButton</a>(), and <a href="q3progressdialog.html#totalSteps-prop">setTotalSteps</a>().</p>
<!-- @@@Q3ProgressDialog -->
<!-- $$$Q3ProgressDialog$$$Q3ProgressDialogconstQString&constQString&intQWidget*Qt::WindowFlags -->
<h3 class="fn"><a name="Q3ProgressDialog-4"></a>Q3ProgressDialog::<span class="name">Q3ProgressDialog</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>labelText</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>cancelButtonText</i>, <span class="type">int</span> <i>totalSteps</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>creator</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = 0 )</h3>
<p>Constructs a progress dialog.</p>
<p>The <i>labelText</i> is text used to remind the user what is progressing.</p>
<p>The <i>cancelButtonText</i> is the text to display on the cancel button, or 0 if no cancel button is to be shown.</p>
<p>The <i>totalSteps</i> 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 setProgress(0). As each file is processed call setProgress(1), setProgress(2), etc., finally calling setProgress(50) after examining the last file.</p>
<p>The <i>creator</i> argument is the widget to use as the dialog's parent. The widget flags, <i>f</i>, are passed to the <a href="qdialog.html#QDialog">QDialog::QDialog</a>() constructor.</p>
<p><b>See also </b><a href="q3progressdialog.html#labelText-prop">setLabelText</a>(), <a href="q3progressdialog.html#setLabel">setLabel</a>(), <a href="q3progressdialog.html#setCancelButtonText">setCancelButtonText</a>(), <a href="q3progressdialog.html#setCancelButton">setCancelButton</a>(), and <a href="q3progressdialog.html#totalSteps-prop">setTotalSteps</a>().</p>
<!-- @@@Q3ProgressDialog -->
<!-- $$$~Q3ProgressDialog[overload1]$$$~Q3ProgressDialog -->
<h3 class="fn"><a name="dtor.Q3ProgressDialog"></a>Q3ProgressDialog::<span class="name">~Q3ProgressDialog</span> ()</h3>
<p>Destroys the progress dialog.</p>
<!-- @@@~Q3ProgressDialog -->
<!-- $$$cancel[overload1]$$$cancel -->
<h3 class="fn"><a name="cancel"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">cancel</span> ()<tt> [slot]</tt></h3>
<p>Resets the progress dialog. <a href="q3progressdialog.html#wasCanceled-prop">wasCanceled</a>() becomes true until the progress dialog is reset. The progress dialog becomes hidden.</p>
<!-- @@@cancel -->
<!-- $$$canceled[overload1]$$$canceled -->
<h3 class="fn"><a name="canceled"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">canceled</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when the cancel button is clicked. It is connected to the <a href="q3progressdialog.html#cancel">cancel</a>() slot by default.</p>
<p><b>See also </b><a href="q3progressdialog.html#wasCanceled-prop">wasCanceled</a>().</p>
<!-- @@@canceled -->
<!-- $$$cancelled[overload1]$$$cancelled -->
<h3 class="fn"><a name="cancelled"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">cancelled</span> ()<tt> [signal]</tt></h3>
<p>Use <a href="q3progressdialog.html#canceled">canceled</a>() instead.</p>
<!-- @@@cancelled -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn"><a name="changeEvent"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">changeEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>ev</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$closeEvent[overload1]$$$closeEventQCloseEvent* -->
<h3 class="fn"><a name="closeEvent"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">closeEvent</span> ( <span class="type"><a href="qcloseevent.html">QCloseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#closeEvent">QWidget::closeEvent</a>().</p>
<!-- @@@closeEvent -->
<!-- $$$forceShow[overload1]$$$forceShow -->
<h3 class="fn"><a name="forceShow"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">forceShow</span> ()<tt> [protected slot]</tt></h3>
<p>Shows the dialog if it is still hidden after the algorithm has been started and <a href="q3progressdialog.html#minimumDuration-prop">minimumDuration</a> milliseconds have passed.</p>
<p><b>See also </b><a href="q3progressdialog.html#minimumDuration-prop">setMinimumDuration</a>().</p>
<!-- @@@forceShow -->
<!-- $$$reset[overload1]$$$reset -->
<h3 class="fn"><a name="reset"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">reset</span> ()<tt> [slot]</tt></h3>
<p>Resets the progress dialog. The progress dialog becomes hidden if <a href="q3progressdialog.html#autoClose-prop">autoClose</a>() is true.</p>
<p><b>See also </b><a href="q3progressdialog.html#autoClose-prop">setAutoClose</a>() and <a href="q3progressdialog.html#autoReset-prop">setAutoReset</a>().</p>
<!-- @@@reset -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn"><a name="resizeEvent"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">resizeEvent</span> ( <span class="type"><a href="qresizeevent.html">QResizeEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$setBar[overload1]$$$setBarQ3ProgressBar* -->
<h3 class="fn"><a name="setBar"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">setBar</span> ( <span class="type"><a href="q3progressbar.html">Q3ProgressBar</a></span> * <i>bar</i> )</h3>
<p>Sets the progress bar widget to <i>bar</i>. The progress dialog resizes to fit. The progress dialog takes ownership of the progress <i>bar</i> which will be deleted when necessary, so do not use a progress bar allocated on the stack.</p>
<!-- @@@setBar -->
<!-- $$$setCancelButton[overload1]$$$setCancelButtonQPushButton* -->
<h3 class="fn"><a name="setCancelButton"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">setCancelButton</span> ( <span class="type"><a href="qpushbutton.html">QPushButton</a></span> * <i>cancelButton</i> )</h3>
<p>Sets the cancel button to the push button, <i>cancelButton</i>. 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><b>See also </b><a href="q3progressdialog.html#setCancelButtonText">setCancelButtonText</a>().</p>
<!-- @@@setCancelButton -->
<!-- $$$setCancelButtonText[overload1]$$$setCancelButtonTextconstQString& -->
<h3 class="fn"><a name="setCancelButtonText"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">setCancelButtonText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>cancelButtonText</i> )<tt> [slot]</tt></h3>
<p>Sets the cancel button's text to <i>cancelButtonText</i>.</p>
<p><b>See also </b><a href="q3progressdialog.html#setCancelButton">setCancelButton</a>().</p>
<!-- @@@setCancelButtonText -->
<!-- $$$setLabel[overload1]$$$setLabelQLabel* -->
<h3 class="fn"><a name="setLabel"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">setLabel</span> ( <span class="type"><a href="qlabel.html">QLabel</a></span> * <i>label</i> )</h3>
<p>Sets the label to <i>label</i>. 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><b>See also </b><a href="q3progressdialog.html#labelText-prop">setLabelText</a>().</p>
<!-- @@@setLabel -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn"><a name="showEvent"></a><span class="type">void</span> Q3ProgressDialog::<span class="name">showEvent</span> ( <span class="type"><a href="qshowevent.html">QShowEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#showEvent">QWidget::showEvent</a>().</p>
<!-- @@@showEvent -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> Q3ProgressDialog::<span class="name">sizeHint</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<p>Returns a size that fits the contents of the progress dialog. The progress dialog resizes itself as required, so you should not need to call this yourself.</p>
<!-- @@@sizeHint -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
 
     |