I have a QMainWindow
that contains several QDockWidget
s. Only one of them should be shown at a time. My Problem is:
When I hide a dockWidget and show another, the size of the newly shown is the same as the just hidden, no matter what QSizePolicys, sizeHint, sizeConstraint I set! I want the newly shown to restore its own last size but I can't find any method to resize a QDockWidget
, without fixing its size with setMinimumSize
and setMaximumSize
.
In fact there is one way but I consider it very ugly:
setMinimumWidth(500);
setMaximumWidth(500);
qApp().processEvents();
setMinimumWidth(0);
setMaximumWidth(9999);
There must be a better way?! Any suggestions?