[SOLVED] Keep layout content at the top?
I have a "list" of widgets inside of a vertical layout inside of a scroll area, looking like this:
The problem is when the window height is increased the list items do not keep aligned to the top of the windows:
Any suggestions how to pin the content of the layout to keep at the top?
JulienMaille last edited by
Did you tried adding a vertical spacer at the bottom? Or simply use a "QVBoxLayout":http://doc.qt.digia.com/qt/qvboxlayout.html
Never mind that, I had already set alignment to Qt::AlignTop, but ... on the wrong layout, setting it on the actual layout fixed the issue.
BelenMuñoz last edited by
One question, what happens when you make the window smaller? It looks like widgets have a fixed size.
I used nested layouts (lots of them) to solve this problem.