Minimize the space widgets fill in a QGridLayout
<p>Below is a picture of my <code>QDockWidget</code>, which has a <code>QFrame</code>, and this <code>QFrame</code> has a <code>QGridLayout</code>. The single row I have in this layout places itself in the middle, but I'd like it to just sit neatly at the top instead. </p>

<p>Does <code>QGridLayout</code> have any methods for its widgets to fill as little space as possible?</p>

<p><a href="http://i.stack.imgur.com/ebnrc.png" rel="nofollow"><img src="http://i.stack.imgur.com/ebnrc.png" alt="enter image description here"></a></p>

<p>Add a vertically expanding <a href="http://doc.qt.io/qt-4.8/qspaceritem.html" rel="nofollow">spacer-item</a> to the bottom of the grid-layout, so that it pushes the widgets above it to the top.</p>

python pyqt qgridlayout