You would have to hide the removed widgets. Removing a widget from a layout only means that the widget is no more managed by the layout and so it will stay in the upper left corner unless it is re-parented. I do personally find it a good idea to avoid dynamically changing layouts as much as possible and use for example a stacked widget or layout instead. Of course they don't fit to all situations. In this case you would most likely have to disable the layout during the changes to avoid the flicker, at least if there are several changes in a row.
Bookmarks