title: QVBoxLayout hides part of its contents
body: <p>I am writing a program to read a number of units consisting of two fields. It has to be graphic, so to store and display all the input fields I use QVBoxLayout and it looks like this:
  <a href="https://i.stack.imgur.com/l5eg5.png" rel="nofollow noreferrer">Input fields</a></p>
  <p>In order to avoid all the inconveniences that may occur when the window is resized, I wrote some code to automatically resize this layout so it fills whole window vertically:</p>
  <pre><code>void resizeLayout(const int&amp; w, const int&amp; h, QVBoxLayout* box) {
      QRect prevGeom = box-&gt;geometry();
      prevGeom.setHeight(h);
      prevGeom.setWidth(w);
      box-&gt;setGeometry(prevGeom);
  }
  </code></pre>
  <p>And it works relatively fine if not for one thing. When I resize it compresses or hides some input fields like this:<a href="https://i.stack.imgur.com/Y4s49.png" rel="nofollow noreferrer">That's not right</a>
  Anybody knows what am I doing wrong here?</p>