Update content in windows app.



  • Hi ;)
    I'm making simple desktop application and I have a small problem.
    How can I update content in my window?

    Example: I have got something in my window (few label and buttons) and when I click button "next" I would like to see new contents. I have looked in QMdiArea classes but i didn't find it.

    Any sugestions?
    Thanks in advance ;)


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Sounds like you are looking for "QWizard":http://qt-project.org/doc/qt-5/qwizard.html

    Hope it helps



  • Another way is to use QStackWidget or QStackedLayou both provide ways for you to have multiple widgets ready to show simply by telling the stackwidget(layout) which one to show.

    Example:

    @mainWindowWorkArea = QWidget();
    stackLayout = new QStackedLayout();
    mainWindowWoarkArea->setLayout(stackLayout);

    label1 = new QLabel("one");
    label2 = new QLabel("two");

    stackLayout->addWidget(label1);
    stackLayout->addWidget(label2);
    stackLayout->setCurrentWidget(label1);
    .
    .
    .
    void myPushButtonSlot()
    {
    stackLayout->setCurrentWidget(label2);
    } @

    Hope this is of some help



  • Thanks! QWizard is what I was looking for.
    @DBoosalis thanks also for your answer. It's very helpful.


Log in to reply
 

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