title: QProgressDialog does not display immediately
body: <p>I have a <code>QProgressDialog</code> that I want to display immediately </p>
  
  <pre><code>QProgressDialog *progress = new QProgressDialog("Downloading files...", 
    "Cancel", 0, 2*selection.size()+1);
  progress-&gt;setMinimumDuration(0);
  progress-&gt;setWindowModality(Qt::WindowModal);
  progress-&gt;setValue(0);
  </code></pre>
  
  <p>Then I run a <code>for</code> loop with the task and finally assign the maximum value:</p>
  
  <pre><code>for (int i = 1; i &lt; selection.size()+1; ++i) 
  {
    progress-&gt;setValue(2*i-1);
    if (progress-&gt;wasCanceled())
      break;
    do_half_task();
    progress-&gt;setValue(2*i);
    if (progress-&gt;wasCanceled())
      break;
    do_second_half();
  }
  progress-&gt;setValue(2*selection.size()+1);
  </code></pre>
  
  <p>But with this code, the dialog window borders appear, transparents without any widgets inside, and only gets filled with the label and progressbar when a full for loop has completed. </p>
  
  <p>I think this is because only after a full loop has completed is that Qt can compute the duration of each step, and check that it will be <code>&gt;0</code> which I am setting as minimum duration. However, from the docs I see </p>
  
  <blockquote>
    <p>minimumDuration : int</p>
    
    <p>If set to 0, the dialog is always shown as soon as any progress is set. The default is 4000 milliseconds.</p>
  </blockquote>
  
  <p>From where I would've expected the dialog to show up immediately in the first loop pass after setting <code>progress-&gt;setValue(1)</code>.  </p>
  
  <p>How can I get my <code>QProgressDialog</code> to appear immediately?</p>