0

I have 3 QDockWidgets in my main window. One is docked to the top of the window when initialised and the other two are docked side-by-side at the bottom of the window. The central widget is hidden.

Initially everything is of the expected size but when I close the two QDockWidget instances that are docked to the bottom and re-open them again, their height is smaller and the widget at the top is larger.

If I undock the widgets in question and go through the same process then the size is maintained as expected - it is only when they are docked that the height is lost.

Any ideas?

Thanks, Alan

Alan Spark
  • 8,152
  • 8
  • 56
  • 91
  • I think it is not possible to fully control the sizes of the dockwidgets when they are docked. At least that is my experience. – user2672165 May 02 '14 at 12:43
  • That is a shame. I've tried resizing them too but I would have expected it to return to the state it was in when the window was first loaded without any manual resizing :( – Alan Spark May 02 '14 at 12:47
  • maintain their state yourself. Play with size constraints. – UmNyobe May 02 '14 at 12:55
  • @UmNyobe Do you mean setting the size policy? I have tried setting the widget that is taking up too much space to have a minimum size policy but that didn't make any difference... – Alan Spark May 02 '14 at 13:08
  • In my experience QDockWidgets act like wrappers to the content widgets they contain. In other words if you set appropriate size hints and size policies or set appropriate minimum sizes for these widgets the problem should be resolved. Alternatively setting the minimum size of the dock widget should work although this is kind of restrictive depending on the design. – DanielJG May 02 '14 at 16:38

0 Answers0