QWizard Backbutton Ui issue
Hi again!
I'm making a little application. I've do it with QWizard and QWizardPages. I Have added 2 CustomButtons to the wizard so it has 5 buttons down: ButA, ButB, Back, Next/Finish, and Cancel.
ButA and ButB don't have to appear in all WizardPages.
Eg: WP0: just ButB
WP1: ButA and ButB
To do that, I have:
Code:
void WP0::initializePage()
{
wizard()->button(QWizard::CustomButton1)->setVisible(false);
}
With that when the app starts, you can't see butA. BUT if you go to the next page (where you see ButA and ButB) and then you click on BackButton, then you see ButA in WP0. I supose that then you click on BackButton there is no call to WP0::initializePage() so my question is: how or where should I call that wizard()->button(QWizard::CustomButton1)->setVisible(false);
to never see ButA on WP0 ? Or what should I do?
Re: QWizard Backbutton Ui issue
One option would be to connect to the currentIdChanged() signal and do the button setup there.
Cheers,
_
Re: QWizard Backbutton Ui issue
Hi,
Do you mean to connect wp1 currentIdChanged() to wp0 custombutton ???
I'm still trying to understand how connect works :)
Re: QWizard Backbutton Ui issue
That is a signal of QWizard, not of the pages.
You connect it to a slot, ideally in the class that adds the two additional buttons, and in that slot you change the button visibility based on which page is currently active.
Cheers,
_
Re: QWizard Backbutton Ui issue
Hi,
I think I understand what you mean. How should I construct that connect? If I am in Wizard class which has the buttons:
connect(?,SIGNAL(currentIdChanged(int)),this,SLOT( ConfigMyButtons(int))
and then make the function like:
void Wizard::ConfigMyButtons(int i)
{
switch (i)
[...]
}
Re: QWizard Backbutton Ui issue
Quote:
Originally Posted by
roseicollis
I don't know the qmake version but I'm working with Qt5 if that helps.
Hmm? I didn't mention qmake or requested a Qt version, did I?
Quote:
Originally Posted by
roseicollis
I think I understand what you mean. How should I construct that connect? If I am in Wizard class which has the buttons:
connect(?,SIGNAL(currentIdChanged(int)),this,SLOT( ConfigMyButtons(int))
You are in the wizard class, this is a signal of QWizard, so the sender object is "this"
Cheers,
_
Re: QWizard Backbutton Ui issue
Srry it was an answer to another post and I don't know how did I put it here, I already edited it.
okok hank you!