PDA

View Full Version : can a qdockwidget be smaller than the contained widgets?



billconan
13th November 2009, 19:55
hello guys,

i have a dockwidget, containing so many buttons. i want the size of the widget be smaller than the height of all the buttons adding up. but it seems that i'm not allowed to to that. but i did see some qt program allow the flexible adjustment of the dockwidget's height.

but i don't know how to do that.

i'm attaching an image, on the left, is the dockwidget i have now, the top dockwidget cannot be smaller, because of the button heights.

on the right, there is a fake image i made to show the effect i want. i want the dockwidget to hide some buttons if they are outside the region, but it can't, it just cannot be smaller.

better if the dockwidget can show vertical scrollbar when widgets are outside the region, but it seems that the dockwidget can only show horizontal scrallbar when the widget's width is not enough.

thanks.

Lykurg
14th November 2009, 09:21
first thought: use a QScrollArea (or use setGeometry without a layout (which is not the best solution))