This QDockWidget contains a QGridLayout.

At run time a user can right click on some widgets in another area and add them to the grid of this dock widget. The widgets just overlap and look bad until the user manually resizes the dock widget. When they manually expand the dock widget to an acceptable grid look, that becomes the minimum size. I've also noticed that if you toggle the dock window visibility off and then on it will resize to an appropriate minimum size.

How can i get the dockwidget to auto resize?