I wanted to add that changing the size of the docked QDockWidget programmatically using resize works fine, until the main window is dragged. When that happens, the QDockWidget returns to its original horizontal size.

What am I missing?