Solved "One way" QWizard
-
Hello,
I want to completely disable
BackButton
inQWizard
. 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 usingQWizard
so I can miss something in the docs.
-
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 byQWizard
reseting these settings (showing all buttons) at each page switch (however Ihide()
the button ininitializePage(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!