PDA

View Full Version : QWizard and QPushButton



rmagro
6th December 2012, 10:24
Hi all,
I would like to know if it's possible to have a QPushButton in a QWizard page having the same role of the "Next button".. and how to do it
Many thanks

Lesiok
6th December 2012, 10:56
What is a problem : do You want to have 2 buttons or to change text on Next button ?

rmagro
6th December 2012, 12:07
I would like to have another button (a QPushButton) with the same role of the next button.. I mean if I click on it I would like to go next!

I tried to connect this second button like this...

connect(goButton, SIGNAL(clicked()), this, SLOT(example()));

...

void myWizardPage::example()
{
myWizardPage::validatePage();
}

but it doesn't work..

amleto
6th December 2012, 12:45
Only a QWizard would normally go to next page. Why do you want to do this from the QWizardPage?

you could try this, though


void myWizardPage::example()
{
QWizard* wiz = wizard();
if (wiz == NULL)
return;

wiz->next();
}

Lesiok
6th December 2012, 12:49
What it is "it doesn't work" ? Show us real code.
Just read about QWizard buttons especially custom buttons and QWizard signal customButtonClicked(int).

rmagro
6th December 2012, 13:25
I wrote "it doesn't work" because it did go correctly on validatePage() method but then it didn't go on the next page.

Anyway your solution works perfectly, and it goes on the next page ! Great!

Thank you so much

Roby