[PySide] animate QStackedLayout?

Aaron Richiger a.richi at bluewin.ch
Wed Apr 4 11:06:52 CEST 2012

Hello frank!

I just changed your code a little with overwriting QStackedWidget. But 
for your purpose, QtStackedWidget seems the wrong widget for me, because 
it's designed to always show only one widget at a time, but what you 
want (I guess) is having a short moment where you see the old page 
sliding out and the new one already behind. You could do so by 
implementing your own StackedWidget. Please note, that my quick and 
dirty version is just a possibility to solve your issue, but there are 
probably more elegant ways to do so (QtAnimation, QtQuick) with less 
overhead. You get the code here:


I hope, this gives you a rough idea of this possibility!


Am 04.04.2012 06:46, schrieb Frank Rueter | OHUfx:
> Hi everyone,
> I'm very new to Qt/PySide and am wondering if it's possible to add an
> animation effect to, let's say, QStackedLayout, for when the page
> changes. I guess it'd something similar to the way the AppStore works.
> In this example I'd like to see the new button "push" the old button out
> of view when the combobox changes:
> http://pastebin.com/i5sFgQzE
> I'm happy to take a good ol' fashioned RTFM, I'm just having a hard time
> finding the right bit of information out there.
> Any help would be greatly appreciated.
> Cheers,
> frank
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

More information about the PySide mailing list