PDA

View Full Version : Resizing of WidgetStacks



soul_rebel
5th April 2008, 18:31
Hi,
I have a problem with QStackedWidget. I have set its sizepolicy to (Preferred,Minimum) and I have set the Policy on all "pages" to the same behaviour... this results in the size of the stack always being the maximum "minumum size of alles pages", however I want it to be the minimum size of the current page!

How would I do that?

Thanks!

jpn
5th April 2008, 18:40
One could reimplement sizeHint() to return the size hint of the current page.

soul_rebel
5th April 2008, 19:58
Hm, that helped a little bit.
The Widget is smaller now, but still too big.
I tried to setFixedSize(ws->currentWidget()->sizeHint()) on page-change and that makes the page the right size, but this is not propagated to widgets that contain the stack and doesnt seem very clean to me.

What else could I do to make it smaller?

Thx!

wysota
5th April 2008, 20:16
How about setting the sizeHint of the stack to Fixed or enforcing a layout constraint on all pages?