Nominate our 2022 Qt Champions!

[SOLVED] QT Swipe-animation to other .ui file

  • I'm working on an application with a login page and a registration page. All the widgets on the login form have been placed using the design tab in QT creator.

    How would I go about animating all widgets on the login at the same time to swipe off to the side and introduce the register page - stored in another ui-file? I tried adding all widgets to a QStackedWidget and animate the "pos" property with a QPropertyAnimation - but every widget I add to it vanishes from the form.

    I just can't seem to figure this out - any help is very appreciated!

    Kind regards,



    Posted another question on the forum over here:

    Any thoughts you might have on that are also very appreciated.


  • Lifetime Qt Champion



    If you placed a widget (A) on your main form (from "container" category) and inside this widget
    you placed 2 other widgets for login and register.
    Then make sure that the size of A only shows the Login widget.
    Then you idea with QPropertyAnimation could easy Slide Login away and Register into view.
    You could also play around with a scroll area.

    Also if you IU file has Widget as parent, then using the promote feature, you could get the controls from the UIs
    directly into the Widget containers inside A. (first shown when run)

    but every widget I add to it vanishes from the form.

    You add them in Creator but when program is run, they are gone, or how do you mean ?

  • Thank you for your swift response!

    By using the Designer to add the widgets to the stacked widget instead I finally managed to get the whole thing working. Thank you!


  • Lifetime Qt Champion


    Ok, that is super.

    So you slide inside the stacked widget and then just switch index/page?

  • I slide it out of frame , change the current index, QWidget::move() it to the the other side of the screen (out of frame) and then slide it back in with the new index. I might upload a demo to youtube - it looks pretty neat!


  • Lifetime Qt Champion

    Ok, sounds neat.
    Would be cool to see. :)

    ps. please flag it as solved if possible.

Log in to reply