title: QScrollArea widget auto resize when adding child widgets
body: <p>I have the following structure:</p>
  
  <pre><code>QScrollArea
    - QWidget (with QHBoxLayout)
      - QLabel
      - QLabel
      - QLabel
      ...
  </code></pre>
  
  <p>QLabels are generated automatically with random text.
  How to change the size of the widget automatically to fit labels?
  At the moment I can see the widget only by setting a fixed size.</p>
  
  <p><strong>Solution:</strong></p>
  
  <p>After creating QLabel I store its width:</p>
  
  <pre><code>int widthSum = 0;
  for ( ... ){
      ...
      widthSum += label-&gt;sizeHint().width();
  }
  </code></pre>
  
  <p>And after the cycle I set fixed width to widget:</p>
  
  <pre><code>widget-&gt;setFixedWidth(widthSum);
  </code></pre>
  
  <p>Thanks @shobi for a hint!</p>