Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > b796bb6846bef0871594624de2c980c0 > files > 3972

qtbase5-doc-5.12.6-4.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qprogressdialog.cpp -->
  <title>QProgressDialog Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QProgressDialog</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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="#reimplemented-public-functions">Reimplemented 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="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented 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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QProgressDialog Class</h1>
<!-- $$$QProgressDialog-brief -->
<p>The <a href="qprogressdialog.html">QProgressDialog</a> class provides feedback on the progress of a slow operation. <a href="#details">More...</a></p>
<!-- @@@QProgressDialog -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QProgressDialog&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qdialog.html">QDialog</a></td></tr></table></div><ul>
<li><a href="qprogressdialog-members.html">List of all members, including inherited members</a></li>
<li><a href="qprogressdialog-obsolete.html">Obsolete members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qprogressdialog.html#autoClose-prop">autoClose</a></b> : bool</li>
<li class="fn"><b><a href="qprogressdialog.html#autoReset-prop">autoReset</a></b> : bool</li>
<li class="fn"><b><a href="qprogressdialog.html#labelText-prop">labelText</a></b> : QString</li>
<li class="fn"><b><a href="qprogressdialog.html#maximum-prop">maximum</a></b> : int</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qprogressdialog.html#minimum-prop">minimum</a></b> : int</li>
<li class="fn"><b><a href="qprogressdialog.html#minimumDuration-prop">minimumDuration</a></b> : int</li>
<li class="fn"><b><a href="qprogressdialog.html#value-prop">value</a></b> : int</li>
<li class="fn"><b><a href="qprogressdialog.html#wasCanceled-prop">wasCanceled</a></b> : const bool</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">2 properties inherited from <a href="qdialog.html#properties">QDialog</a></li>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#QProgressDialog">QProgressDialog</a></b>(QWidget *<i>parent</i> = nullptr, Qt::WindowFlags <i>f</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#QProgressDialog-1">QProgressDialog</a></b>(const QString &amp;<i>labelText</i>, const QString &amp;<i>cancelButtonText</i>, int <i>minimum</i>, int <i>maximum</i>, QWidget *<i>parent</i> = nullptr, Qt::WindowFlags <i>f</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#dtor.QProgressDialog">~QProgressDialog</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#autoClose-prop">autoClose</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#autoReset-prop">autoReset</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#labelText-prop">labelText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#maximum-prop">maximum</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#minimum-prop">minimum</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#minimumDuration-prop">minimumDuration</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#open">open</a></b>(QObject *<i>receiver</i>, const char *<i>member</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#autoClose-prop">setAutoClose</a></b>(bool <i>close</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#autoReset-prop">setAutoReset</a></b>(bool <i>reset</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#setBar">setBar</a></b>(QProgressBar *<i>bar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.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="qprogressdialog.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="qprogressdialog.html#value-prop">value</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#wasCanceled-prop">wasCanceled</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#sizeHint">sizeHint</a></b>() const override</td></tr>
</table></div>
<ul>
<li class="fn">8 public functions inherited from <a href="qdialog.html#public-functions">QDialog</a></li>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#cancel">cancel</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#reset">reset</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#setCancelButtonText">setCancelButtonText</a></b>(const QString &amp;<i>cancelButtonText</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#labelText-prop">setLabelText</a></b>(const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#maximum-prop">setMaximum</a></b>(int <i>maximum</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#minimum-prop">setMinimum</a></b>(int <i>minimum</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.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="qprogressdialog.html#setRange">setRange</a></b>(int <i>minimum</i>, int <i>maximum</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#value-prop">setValue</a></b>(int <i>progress</i>)</td></tr>
</table></div>
<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="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#canceled">canceled</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">3 signals inherited from <a href="qdialog.html#signals">QDialog</a></li>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#changeEvent">changeEvent</a></b>(QEvent *<i>ev</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#closeEvent">closeEvent</a></b>(QCloseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#resizeEvent">resizeEvent</a></b>(QResizeEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#showEvent">showEvent</a></b>(QShowEvent *<i>e</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">6 protected functions inherited from <a href="qdialog.html#protected-functions">QDialog</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<a name="protected-slots"></a>
<h2 id="protected-slots">Protected Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprogressdialog.html#forceShow">forceShow</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QProgressDialog-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qprogressdialog.html">QProgressDialog</a> 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. <a href="qprogressdialog.html">QProgressDialog</a> 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="qprogressdialog.html#minimumDuration-prop">minimumDuration</a>() (4 seconds by default).</p>
<p>Use <a href="qprogressdialog.html#minimum-prop">setMinimum</a>() and <a href="qprogressdialog.html#maximum-prop">setMaximum</a>() or the constructor to set the number of &quot;steps&quot; in the operation and call <a href="qprogressdialog.html#value-prop">setValue</a>() as the operation progresses. The number of steps 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 the value set by <a href="qprogressdialog.html#minimum-prop">setMinimum</a>(), and the progress dialog shows that the operation has finished when you call <a href="qprogressdialog.html#value-prop">setValue</a>() with the value set by <a href="qprogressdialog.html#maximum-prop">setMaximum</a>() as its argument.</p>
<p>The dialog automatically resets and hides itself at the end of the operation. Use <a href="qprogressdialog.html#autoReset-prop">setAutoReset</a>() and <a href="qprogressdialog.html#autoClose-prop">setAutoClose</a>() to change this behavior. Note that if you set a new maximum (using <a href="qprogressdialog.html#maximum-prop">setMaximum</a>() or <a href="qprogressdialog.html#setRange">setRange</a>()) that equals your current <a href="qprogressdialog.html#value-prop">value</a>(), the dialog will not close regardless.</p>
<p>There are two ways of using <a href="qprogressdialog.html">QProgressDialog</a>: modal and modeless.</p>
<p>Compared to a modeless <a href="qprogressdialog.html">QProgressDialog</a>, a modal <a href="qprogressdialog.html">QProgressDialog</a> is simpler to use for the programmer. Do the operation in a loop, call <a href="qprogressdialog.html#value-prop">setValue</a>() at intervals, and check for cancellation with <a href="qprogressdialog.html#wasCanceled-prop">wasCanceled</a>(). For example:</p>
<pre class="cpp">

      <span class="type"><a href="qprogressdialog.html#QProgressDialog">QProgressDialog</a></span> progress(<span class="string">&quot;Copying files...&quot;</span><span class="operator">,</span> <span class="string">&quot;Abort Copy&quot;</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> numFiles<span class="operator">,</span> <span class="keyword">this</span>);
      progress<span class="operator">.</span>setWindowModality(<span class="type">Qt</span><span class="operator">::</span>WindowModal);

      <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator">&lt;</span> numFiles; i<span class="operator">+</span><span class="operator">+</span>) {
          progress<span class="operator">.</span>setValue(i);

          <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>setValue(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="../qtcore/qtimer.html">QTimer</a> (or <a href="../qtcore/qobject.html#timerEvent">QObject::timerEvent</a>()) or <a href="../qtcore/qsocketnotifier.html">QSocketNotifier</a>; or performed in a separate thread. A <a href="qprogressbar.html">QProgressBar</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="qprogressdialog.html#canceled">canceled</a>() signal to a slot that stops the operation, and call <a href="qprogressdialog.html#value-prop">setValue</a>() at intervals. For example:</p>
<pre class="cpp">

  <span class="comment">// Operation constructor</span>
  Operation<span class="operator">::</span>Operation(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> <span class="operator">*</span>parent)
      : <span class="type"><a href="../qtcore/qobject.html#QObject">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"><a href="qprogressdialog.html#QProgressDialog">QProgressDialog</a></span>(<span class="string">&quot;Operation in progress.&quot;</span><span class="operator">,</span> <span class="string">&quot;Cancel&quot;</span><span class="operator">,</span> <span class="number">0</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="../qtcore/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">&gt;</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">&gt;</span>setValue(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">&gt;</span> pd<span class="operator">-</span><span class="operator">&gt;</span>maximum())
          t<span class="operator">-</span><span class="operator">&gt;</span>stop();
  }

  <span class="type">void</span> Operation<span class="operator">::</span>cancel()
  {
      t<span class="operator">-</span><span class="operator">&gt;</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="qprogressdialog.html#setLabel">setLabel</a>(), <a href="qprogressdialog.html#setBar">setBar</a>(), and <a href="qprogressdialog.html#setCancelButton">setCancelButton</a>(). The functions <a href="qprogressdialog.html#labelText-prop">setLabelText</a>() and <a href="qprogressdialog.html#setCancelButtonText">setCancelButtonText</a>() set the texts shown.</p>
<p class="centerAlign"><img src="images/fusion-progressdialog.png" alt="A progress dialog shown in the Fusion widget style." /></p></div>
<p><b>See also </b><a href="qdialog.html">QDialog</a>, <a href="qprogressbar.html">QProgressBar</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Progress Indicator</a>, <a href="qtwidgets-dialogs-findfiles-example.html">Find Files Example</a>, and <a href="qtwidgets-itemviews-pixelator-example.html">Pixelator Example</a>.</p>
<!-- @@@QProgressDialog -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoClose-prop$$$autoClose$$$setAutoClosebool -->
<h3 class="fn" id="autoClose-prop"><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 <a href="qprogressdialog.html#reset">reset</a>()</p>
<p>The default is true.</p>
<p><b>Access functions:</b></p>
<div class="table"><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>close</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qprogressdialog.html#autoReset-prop">setAutoReset</a>().</p>
<!-- @@@autoClose -->
<!-- $$$autoReset-prop$$$autoReset$$$setAutoResetbool -->
<h3 class="fn" id="autoReset-prop"><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 <a href="qprogressdialog.html#reset">reset</a>() as soon as <a href="qprogressdialog.html#value-prop">value</a>() equals <a href="qprogressdialog.html#maximum-prop">maximum</a>()</p>
<p>The default is true.</p>
<p><b>Access functions:</b></p>
<div class="table"><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>reset</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qprogressdialog.html#autoClose-prop">setAutoClose</a>().</p>
<!-- @@@autoReset -->
<!-- $$$labelText-prop$$$labelText$$$setLabelTextconstQString& -->
<h3 class="fn" id="labelText-prop"><a name="labelText-prop"></a><span class="name">labelText</span> : <span class="type"><a href="../qtcore/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>
<div class="table"><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 &amp;<i>text</i>)</td></tr>
</table></div>
<!-- @@@labelText -->
<!-- $$$maximum-prop$$$maximum$$$setMaximumint -->
<h3 class="fn" id="maximum-prop"><a name="maximum-prop"></a><span class="name">maximum</span> : <span class="type">int</span></h3>
<p>This property holds the highest value represented by the progress bar</p>
<p>The default is 100.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>maximum</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMaximum</b></span>(int <i>maximum</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qprogressdialog.html#minimum-prop">minimum</a> and <a href="qprogressdialog.html#setRange">setRange</a>().</p>
<!-- @@@maximum -->
<!-- $$$minimum-prop$$$minimum$$$setMinimumint -->
<h3 class="fn" id="minimum-prop"><a name="minimum-prop"></a><span class="name">minimum</span> : <span class="type">int</span></h3>
<p>This property holds the lowest value represented by the progress bar</p>
<p>The default is 0.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>minimum</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMinimum</b></span>(int <i>minimum</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qprogressdialog.html#maximum-prop">maximum</a> and <a href="qprogressdialog.html#setRange">setRange</a>().</p>
<!-- @@@minimum -->
<!-- $$$minimumDuration-prop$$$minimumDuration$$$setMinimumDurationint -->
<h3 class="fn" id="minimumDuration-prop"><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>
<div class="table"><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></div>
<!-- @@@minimumDuration -->
<!-- $$$value-prop$$$value$$$setValueint -->
<h3 class="fn" id="value-prop"><a name="value-prop"></a><span class="name">value</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 <a href="qprogressdialog.html#minimum-prop">QProgressDialog::minimum</a>() and finally set it to <a href="qprogressdialog.html#maximum-prop">QProgressDialog::maximum</a>(); you can call setValue() any number of times in-between.</p>
<p><b>Warning:</b> If the progress dialog is modal (see <a href="qprogressdialog.html#QProgressDialog">QProgressDialog::QProgressDialog</a>()), setValue() calls <a href="../qtcore/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="qprogressdialog.html">QProgressDialog</a> inside a <a href="qwidget.html#paintEvent">paintEvent</a>()!</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>value</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setValue</b></span>(int <i>progress</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qprogressdialog.html#minimum-prop">minimum</a> and <a href="qprogressdialog.html#maximum-prop">maximum</a>.</p>
<!-- @@@value -->
<!-- $$$wasCanceled-prop$$$wasCanceled -->
<h3 class="fn" id="wasCanceled-prop"><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>
<div class="table"><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></div>
<!-- @@@wasCanceled -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QProgressDialog[overload1]$$$QProgressDialogQWidget*Qt::WindowFlags -->
<h3 class="fn" id="QProgressDialog"><a name="QProgressDialog"></a>QProgressDialog::<span class="name">QProgressDialog</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = ...)</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) &quot;Cancel&quot;.</li>
<li>minimum is 0;</li>
<li>maximum is 100</li>
</ul>
<p>The <i>parent</i> argument is dialog's parent widget. 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="qprogressdialog.html#labelText-prop">setLabelText</a>(), <a href="qprogressdialog.html#setCancelButtonText">setCancelButtonText</a>(), <a href="qprogressdialog.html#setCancelButton">setCancelButton</a>(), <a href="qprogressdialog.html#minimum-prop">setMinimum</a>(), and <a href="qprogressdialog.html#maximum-prop">setMaximum</a>().</p>
<!-- @@@QProgressDialog -->
<!-- $$$QProgressDialog$$$QProgressDialogconstQString&constQString&intintQWidget*Qt::WindowFlags -->
<h3 class="fn" id="QProgressDialog-1"><a name="QProgressDialog-1"></a>QProgressDialog::<span class="name">QProgressDialog</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>labelText</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>cancelButtonText</i>, <span class="type">int</span> <i>minimum</i>, <span class="type">int</span> <i>maximum</i>, <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = ...)</h3>
<p>Constructs a progress dialog.</p>
<p>The <i>labelText</i> is the text used to remind the user what is progressing.</p>
<p>The <i>cancelButtonText</i> is the text to display on the cancel button. If QString() is passed then no cancel button is shown.</p>
<p>The <i>minimum</i> and <i>maximum</i> is the 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 minimum value would be 0, and the maximum would be 50. Before examining the first file, call <a href="qprogressdialog.html#value-prop">setValue</a>(0). As each file is processed call <a href="qprogressdialog.html#value-prop">setValue</a>(1), <a href="qprogressdialog.html#value-prop">setValue</a>(2), etc., finally calling <a href="qprogressdialog.html#value-prop">setValue</a>(50) after examining the last file.</p>
<p>The <i>parent</i> argument is the dialog's parent widget. The parent, <i>parent</i>, and 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="qprogressdialog.html#labelText-prop">setLabelText</a>(), <a href="qprogressdialog.html#setLabel">setLabel</a>(), <a href="qprogressdialog.html#setCancelButtonText">setCancelButtonText</a>(), <a href="qprogressdialog.html#setCancelButton">setCancelButton</a>(), <a href="qprogressdialog.html#minimum-prop">setMinimum</a>(), and <a href="qprogressdialog.html#maximum-prop">setMaximum</a>().</p>
<!-- @@@QProgressDialog -->
<!-- $$$~QProgressDialog[overload1]$$$~QProgressDialog -->
<h3 class="fn" id="dtor.QProgressDialog"><a name="dtor.QProgressDialog"></a><code>[virtual] </code>QProgressDialog::<span class="name">~QProgressDialog</span>()</h3>
<p>Destroys the progress dialog.</p>
<!-- @@@~QProgressDialog -->
<!-- $$$cancel[overload1]$$$cancel -->
<h3 class="fn" id="cancel"><a name="cancel"></a><code>[slot] </code><span class="type">void</span> QProgressDialog::<span class="name">cancel</span>()</h3>
<p>Resets the progress dialog. <a href="qprogressdialog.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" id="canceled"><a name="canceled"></a><code>[signal] </code><span class="type">void</span> QProgressDialog::<span class="name">canceled</span>()</h3>
<p>This signal is emitted when the cancel button is clicked. It is connected to the <a href="qprogressdialog.html#cancel">cancel</a>() slot by default.</p>
<p><b>See also </b><a href="qprogressdialog.html#wasCanceled-prop">wasCanceled</a>().</p>
<!-- @@@canceled -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn" id="changeEvent"><a name="changeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QProgressDialog::<span class="name">changeEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>ev</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$closeEvent[overload1]$$$closeEventQCloseEvent* -->
<h3 class="fn" id="closeEvent"><a name="closeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QProgressDialog::<span class="name">closeEvent</span>(<span class="type"><a href="../qtgui/qcloseevent.html">QCloseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qdialog.html#closeEvent">QDialog::closeEvent</a>().</p>
<!-- @@@closeEvent -->
<!-- $$$forceShow[overload1]$$$forceShow -->
<h3 class="fn" id="forceShow"><a name="forceShow"></a><code>[protected slot] </code><span class="type">void</span> QProgressDialog::<span class="name">forceShow</span>()</h3>
<p>Shows the dialog if it is still hidden after the algorithm has been started and <a href="qprogressdialog.html#minimumDuration-prop">minimumDuration</a> milliseconds have passed.</p>
<p><b>See also </b><a href="qprogressdialog.html#minimumDuration-prop">setMinimumDuration</a>().</p>
<!-- @@@forceShow -->
<!-- $$$open[overload1]$$$openQObject*constchar* -->
<h3 class="fn" id="open"><a name="open"></a><span class="type">void</span> QProgressDialog::<span class="name">open</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>receiver</i>, const <span class="type">char</span> *<i>member</i>)</h3>
<p>Opens the dialog and connects its <a href="qprogressdialog.html#canceled">canceled</a>() signal to the slot specified by <i>receiver</i> and <i>member</i>.</p>
<p>The signal will be disconnected from the slot when the dialog is closed.</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@open -->
<!-- $$$reset[overload1]$$$reset -->
<h3 class="fn" id="reset"><a name="reset"></a><code>[slot] </code><span class="type">void</span> QProgressDialog::<span class="name">reset</span>()</h3>
<p>Resets the progress dialog. The progress dialog becomes hidden if <a href="qprogressdialog.html#autoClose-prop">autoClose</a>() is true.</p>
<p><b>See also </b><a href="qprogressdialog.html#autoClose-prop">setAutoClose</a>() and <a href="qprogressdialog.html#autoReset-prop">setAutoReset</a>().</p>
<!-- @@@reset -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn" id="resizeEvent"><a name="resizeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QProgressDialog::<span class="name">resizeEvent</span>(<span class="type"><a href="../qtgui/qresizeevent.html">QResizeEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qdialog.html#resizeEvent">QDialog::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$setBar[overload1]$$$setBarQProgressBar* -->
<h3 class="fn" id="setBar"><a name="setBar"></a><span class="type">void</span> QProgressDialog::<span class="name">setBar</span>(<span class="type"><a href="qprogressbar.html">QProgressBar</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" id="setCancelButton"><a name="setCancelButton"></a><span class="type">void</span> QProgressDialog::<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&#x2e; use new() to create the button. If <code>nullptr</code> is passed, no cancel button will be shown.</p>
<p><b>See also </b><a href="qprogressdialog.html#setCancelButtonText">setCancelButtonText</a>().</p>
<!-- @@@setCancelButton -->
<!-- $$$setCancelButtonText[overload1]$$$setCancelButtonTextconstQString& -->
<h3 class="fn" id="setCancelButtonText"><a name="setCancelButtonText"></a><code>[slot] </code><span class="type">void</span> QProgressDialog::<span class="name">setCancelButtonText</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>cancelButtonText</i>)</h3>
<p>Sets the cancel button's text to <i>cancelButtonText</i>. If the text is set to QString() then it will cause the cancel button to be hidden and deleted.</p>
<p><b>See also </b><a href="qprogressdialog.html#setCancelButton">setCancelButton</a>().</p>
<!-- @@@setCancelButtonText -->
<!-- $$$setLabel[overload1]$$$setLabelQLabel* -->
<h3 class="fn" id="setLabel"><a name="setLabel"></a><span class="type">void</span> QProgressDialog::<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="qprogressdialog.html#labelText-prop">setLabelText</a>().</p>
<!-- @@@setLabel -->
<!-- $$$setRange[overload1]$$$setRangeintint -->
<h3 class="fn" id="setRange"><a name="setRange"></a><code>[slot] </code><span class="type">void</span> QProgressDialog::<span class="name">setRange</span>(<span class="type">int</span> <i>minimum</i>, <span class="type">int</span> <i>maximum</i>)</h3>
<p>Sets the progress dialog's minimum and maximum values to <i>minimum</i> and <i>maximum</i>, respectively.</p>
<p>If <i>maximum</i> is smaller than <i>minimum</i>, <i>minimum</i> becomes the only legal value.</p>
<p>If the current value falls outside the new range, the progress dialog is reset with <a href="qprogressdialog.html#reset">reset</a>().</p>
<p><b>See also </b><a href="qprogressdialog.html#minimum-prop">minimum</a> and <a href="qprogressdialog.html#maximum-prop">maximum</a>.</p>
<!-- @@@setRange -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn" id="showEvent"><a name="showEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QProgressDialog::<span class="name">showEvent</span>(<span class="type"><a href="../qtgui/qshowevent.html">QShowEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qdialog.html#showEvent">QDialog::showEvent</a>().</p>
<!-- @@@showEvent -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QProgressDialog::<span class="name">sizeHint</span>() const</h3>
<p>Reimplemented from <a href="qdialog.html#sizeHint">QDialog::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>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    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.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>