PDA

View Full Version : QScrollArea Not Showing Properly



tvj4218
26th January 2017, 04:17
I've created a Widget with a QScrollArea inside it, with another widget, scrollAreaContents within the scrollArea.
scrollAreaContents has a bunch of labels within a vertical layout, and, when I run the app, various labels are spaced out within the scrollArea
with plenty of spacing between them. Obviously I don't want this extra spacing. So I right click on the scrollArea in the
designer, go to Layout Alignment and select Top.
This makes the labels in the scrollArea bunch up like I want it to, but the scrollArea now only takes up half the screen.
This also I do not want.
The vertical scroll bar shows up fine as expected. I've disabled the horizontal scrollbar.
scrollArea also within a vertical layout.

I've done all this using the Qt designer. I'm required to use this tool.

Please help. I've tried a bunch of things but nothing seems to work. I've changed the margins and spacing for the top widget
as well as scrollAreaContents widget to all zeros.

Thank you for any help.

n

anda_skoa
26th January 2017, 12:20
Instead of alignment you could try adding a spacer item as the last item of the layout the labels are in.

Cheers,
_

tvj4218
28th January 2017, 00:22
That worked!! Thank you.