is it possible to add layout in QStackedLayout?

  • hi guys. I'm wondering if it's possible to add a QHBoxLayout/QVBoxLayout in a QStackedLayout, so each page of stackedLayout would show different patterns.

    I searched for a while and didn't find anything. I tested addItem but it seems not the one I'm looking for.

    Thnx in advance.

  • Qt Champions 2017

    Hi, when you want to
    mix layouts, its often easier to insert a place holder.
    So you create a QWidget, insert what ever layout
    u like in it and then add this widget to the QStackedLayout.
    And then u inset the "real" widget into this placeholder widgets->layout()

  • @mrjj said:


    holy moly, that works, thanks very much.

  • Qt Champions 2017

    Yes and you can even insert another
    placeholder and have sub - sub layouts if u feel kinky.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.