I have a ScrollArea, containing a VBoxLayout containing several Labels:
realmScroll = QScrollArea(self.container.widget())
realmScroll.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
realmScroll.setWidgetResizable(True) # setting this to False has no effect
self.realmLayout = QVBoxLayout(realmScroll)
realmScroll.setWidget(self.realmLayout.widget())
self.container.addWidget(realmScroll)
for i in range(1, 20):
label = QLabel("test #" + str(i))
label.setMinimumHeight(20)
self.realmLayout.addWidget(label)
However when viewed the layout doesn't scroll, it de-stretches (shrinks?) the items together vertically:
I've tried using minimum heights but this doesn't seem to work - what can I do this to make each label appear separately and cause the scrollview to scroll?