Maybe you should create the layout directly on the viewport without the need to use QVBox (using QWidget would be better here anyway)?

Could you provide a compilable example of the widget? I'll play with it a little to see why the outer layout doesn't work.