In the case of being a QMainWindow central widget, the container is part of a layout, the QMainWindow layout. In the QScrollArea case it is not and it is neither a top level window (which would resize itself).

Cheers,
_