title: How can I get rid of vertical spacing of empty rows in a QGridLayout in Qt?
body: <p>So I have a dialog that consists of one <code>QGridLayout</code> that has two columns of widgets (labels and comboboxes). Depending on the selections of the comboboxes some rows might be hidden.</p>
  
  <p>I figured out that having the dialog call <code>self.layout().setSizeConstraint(QLayout.SetFixedSize)</code> as it shows/hides the comboboxes would make the dialog change size accordingly.</p>
  
  <p>But then I realized that the layout was still showing the vertical spacing of empty rows, thus making the dialog show too much space here and there.</p>
  
  <p>How can I get rid of this? Is there a way to have the layout resize to show only vertical spacing of rows that have visible widgets?</p>