Normally you will get what you see, however, it could be that the QDockWidget, since it is a special kind of container, has some runtime resizing code and attempts to resize to its content.

If your content is not properly layouted, then it will not "see" the content's requirements and fall back to some default size.
You could override that by e.g. setting a minimum width, but ideally you'll fix the layout.

Cheers,
_