PDA

View Full Version : shrink QDockWidget



tuli
14th May 2013, 20:34
Hey,

when i want to shrink a widget i usualy call resize(0,0), which works on normal widgets, but not for QDockWidget (floating or not).
Specifically, i have two QDockWidgets that are automatically docked onto the mainwindow:


addDockWidget(Qt::TopDockWidgetArea, a);
splitDockWidget(a, b, Qt::Horizontal);

Both of them can and will expand to any given size, but both also have a minimum size.
I'd now like to shrink QDockWidget a to occupy as little space as possible, thus allowing b to grow.

Calling


a->show();
a->resize(0,0);

before or after the docking doesnt work.

ChrisW67
14th May 2013, 22:22
Try resizing the QDockWidget content widget.


dw->widget()->resize(0, 0);

tuli
16th May 2013, 21:58
tried it, wont work either.