PyQt expand scrollarea fully when window is big enough
<p>I'm making a small PyQt gui software for some scripts I often use. Part of this gui has a list of buttons to the right, and the amount of buttons can vary from each run of the gui. For that reason I would like to have them in a scrollarea. This works sort of OK, but for some reason the scroll area will not expand the very last bit when the window size permits it (so no scroller would be shown).</p>

<p>It behaves as if a maximumheight has been set elsewhere, even if I set a maximumheight much higher than the window size?!?</p>

<p>If I set the minimumheight to more than widgetsize, the scroller is hidden as expected, but not if minimumsize is smaller so scroller will be used when window is smaller.
<a href="http://i.stack.imgur.com/zVcep.png" rel="nofollow">Cutout, left with minimumheight of 550, and right with minimumheight of 200</a></p>

<pre><code>    self.Pvbox = QtGui.QVBoxLayout()
    self.syncButton=QtGui.QPushButton('Sync')
    self.syncButton.setMaximumWidth(100)
    self.Pvbox.addWidget(self.syncButton)

    PbuttonWdg = QtGui.QWidget()
    Pbuttonlayout = QtGui.QVBoxLayout()
    self.nbuttons=[]
    c=0
    for n in main.Pnames:
        self.nbuttons.append(QtGui.QPushButton(str(n)))
        self.nbuttons[-1].setMaximumWidth(80)
        Pbuttonlayout.addWidget(self.nbuttons[-1])
        c+=1
    PbuttonWdg.setLayout(Pbuttonlayout)
    scroll=QtGui.QScrollArea()
    scroll.setMaximumWidth(110)
    scroll.setMinimumWidth(110)
    scroll.setMinimumHeight(550)
    scroll.setMaximumHeight(800)
    scroll.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
    scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
    scroll.setWidgetResizable(False)
    scroll.setWidget(PbuttonWdg)
    self.Pvbox.addWidget(scroll)

    self.Pvbox.addStretch(1)
    self.localButton=QtGui.QPushButton('Local')
    self.localButton.setMaximumWidth(100)
    self.Pvbox.addWidget(self.localButton)
</code></pre>