I’m creating a calendar app and just finished the appointment view and edit. Basicly it’s a QVBoxLayout with the viewlayout and editlayout in it and I hide and show either the view or edit using signals.
That works just fine, there is 1 issue: in the viewlayout I have a QSpacerItem for some extra spacing and in order to remove the space when viewing the edit-part I change its size.
Like so
if( show_view_hide_edit )
spacer->changeSize(1, 60, QSizePolicy::Expanding, QSizePolicy::Fixed );
else
spacer->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed );
This code works when the widget shows, and when I swap it to “edit”. When I switch it back to view and then go back to edit the spacing is at the top of my screen. It shouldnt really be there. Image shows what happens. (link to image for size)

Without the construction code of your widget it is a little hard to guess, what is going on. Have you tried to insert / remove the SpacerItems with QBoxLayout::insertSpacing ( int index, int size ) and QLayout::removeItem ( QLayoutItem * item )?
And did you call QLayout::invalidate () after changing the size?