Skip to content Skip to sidebar Skip to footer

Pyqt4 - Smooth Window Resize Transition?

When a User opens a particular tab inside the QMainWindow of my PyQt4 driven GUI, the window needs to be automatically resized so that the contents of this particular tab will fit.

Solution 1:

There is QPropertyAnimation which can be used to animate QObject properties, including the size of your window.

I'm not sure if it will work well performance wise, since it will call resize() perpetually, as you say, but it seems like that is what you want.

What you could maybe do is to resize the window, but somehow disable painting (i.e. override paint()) during that animation, so that only the frame is smoothly resized (should be ok) and the interior is not redrawn until the target size has been reached.

Post a Comment for "Pyqt4 - Smooth Window Resize Transition?"