View Full Version : QMainWindow Central Widget - how to maximize size and make dockwidgets minimum size?

20th March 2009, 22:27
I have a QMainWindow that has a central widget. There are a bunch of dockwidgets in the main window also. I'd like to maximize the size of the central widget within the window, and minimize the sizes of the dockwidgets (same as manually moving the size rectangle around the central widget.

When I try and set the size of the central widget to maximum it doesn't make the dockwidgets go to their minimum size. Should I be doing the reverse - set each of the dockwidgets to their minimum sizes?


21st March 2009, 06:59
Try setting size policy to minimum for your dock widgets.

setSizePolicy ( QSizePolicy::Policy Minimum, QSizePolicy::Policy Minimum )

23rd March 2009, 17:26
Unfortunately that doesn't seem to work. If I replace the central widget with another one, the docks all expand to take up space. I need a way to push them all back to their smallest size.