views:

91

answers:

2

QWizard have some options related to the buttons as follows:

    NoDefaultButton
    NoBackButtonOnStartPage
    NoBackButtonOnLastPage
    DisabledBackButtonOnLastPage
    HaveNextButtonOnLastPage
    HaveFinishButtonOnEarlyPages
    NoCancelButton
    CancelButtonOnLeft
    HaveHelpButton
    HelpButtonOnRight

Now these options are not enough to me, is there any way to do the customization??

For example, after setting a QWizardPage as a final page, the "next" button is still there since the page originally have next page.

What I want is to change "next" to "finish" instead of one more "finish" button.

Another example is that at the first page, I want the "back" button shows up but is disabled.

How can I control these buttons in a more flexible way? I want make some buttons disappear and some be disabled.

+1  A: 

If you call the follwing function:

QAbstractButton * QWizard::button ( WizardButton which ) const

with following argument:

QWizard::NextButton

then you should get a pointer to the "Next" button.

The only thing left to do is to call setVisible(bool) function of the button when you are one the last but one (pre-last) page?

I have never done this, just tried to help you.

Narek
A: 

There is another similar question, I don't want to post another question, so I ask here.

I want to do something to the buttons while the Wizard Page comes out. (More exactly, I want to decide the behavior of the button by some other variable).

This cannot be done in the constructor of the Wizard page (maybe because the parent wizard is not exist yet.) And I tried "show" and "initialize" slot, however, the "show" cannot be overwritten, and the "initialize" works, but soon the Wizard will reset the button, and the button setting is gone.

What should I do to decide the button while a specific Wizard page start up??

Claire Huang