PDA

View Full Version : Widgets resize: bug or feature



Odin
12th July 2011, 22:01
Hi,

I have 2 widgest placed in the QVBoxLayout. The first widget has a sizePolicy like this: [Prefered, Fixed, 0, 2]. The second widget has a sizePolicy like this: [Prefered, Expanding, 0, 0].
It works great: the widget on the top has a constant size and the widget on the bottom is changing its size when window gets resized.
I want to make a widget on the top to increase its height and the widget on the bottom to decrease its height when some event happens. I've used QParallelAnimationGroup to do this. And it works well too. But when I resize the window both widgets takes its initial size. Is it possible to make them to keep there new size?

I'm using a PyQt4 if it matters.

Thank you in advance.

Santosh Reddy
13th July 2011, 15:45
Set the new sizePolicy (after animation)

TopWidget: [Fixed, Fixed, 0, 0]
BottomWidget: [Fixed, Fixed, 0, 0]