Search code examples
javaqtcardlayout

Is there an equivalent to the Swing CardLayout in the Qt Framework?


I am designing an Application using the Qt framework, and I want to avoid using multiple dialogs simply because I think it can get messy with having many dialogs open. I was wondering if there was something like Java's CardLayout in the Qt Framework.

Thanks for your help.


Solution

  • The QStackedWidget is very close to the CardLayout

    The QStackedWidget class provides a stack of widgets where only one widget is visible at a time.

    Add as many widgets as you want and every time you load it you can change the widget that is displayed by calling the setCurrentIndex