"One way" QWizard



  • Hello,

    I want to completely disableBackButton in QWizard. Unfortunately I fail to do so...
    My Wizard setup looks like this

    • I have created some pages (as separate files)
    • I have created wizard (opts: NoBackButtonOnLastPage, NoBackButtonOnStartPage)
    • in wizards creator I am creating pages instances and call suitable setPage
    • (hide back somehow)
    • ...
    • profit?
      Or at least I would like these 3 last points to be right :) Do you have any ideas how to hide/delete this button?It is my first time using QWizard so I can miss something in the docs.

  • Qt Champions 2016

    Hi
    Have you tried with
    QAbstractButton * QWizard::button ( WizardButton which ) const
    and simply call hide() on it?

    alternatively i have also seen ppl using a custom layout and leave it out

    QListQWizard::WizardButton button_layout;
    button_layout << QWizard::HelpButton << QWizard::Stretch <<
    QWizard::NextButton << QWizard::CustomButton1 <<
    QWizard::CancelButton;
    this->setButtonLayout(button_layout);

    Also I must ask.:) Would a stackedwidget do just as fine as a wizard?



  • Yep I have tried to hide() it but it does not word. It is strange because it does not hide button at all.
    Mayby it is coused by QWizard reseting these settings (showing all buttons) at each page switch (however Ihide() the button in initializePage(int id))

    As I said it is my first time having to use some kind of wizard and since it is always called wizard i thought QWizard should do :) Ill try with StackedWidget if the layout fails to hide the button.



  • setButtonLayout solved the issue. Thanks!


Log in to reply
 

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