A QBoxLayout
will distribute the widgets evenly over the available space. The easiest way to keep all the widgets packed together at the top of a QVBoxLayout
, is to add a stretchable spacing at the bottom that will push all the widgets up.
You can add a stretch that will take up as much space as it can with QBoxLayout::addStretch()
.