Why does Qt Designer add so much space?
Solution 1:
Just add a Vertical Spacer
to the top and the bottom, then you will have your expected result.
If you would like to add it through the code and not in Designer, you would need to add it on the QLayout with
QBoxLayout::addStretch(int stretch = 0)
orQBoxLayout::addSpacing(int size)
, depending on your need