PDA

View Full Version : How to disable the Next button in a wizard until a certain condition is met



pkjag
11th September 2013, 17:01
Hi all
I was wondering how i would disable the Next button in a wizard page until i have set only four checkboxes checked or clicked them among a bunch of other checkboxes in the wizard page?

anda_skoa
12th September 2013, 09:38
http://qt-project.org/doc/qt-5.0/qtwidgets/qwizardpage.html#isComplete

Cheers,
_

pkjag
12th September 2013, 13:01
So i did this:


connect(checkmeCheckBox, SIGNAL(toggled()),wizard1->button(QWizard::NextButton), SLOT(reactToToggle()));
...
...
...
//for all the checkboxes in myPage

int myPage::reactToToggle(bool checked)
{
static int i = 0;
if(checked)
++i;
return i;
}

void myPage::returns(bool checked)
{
if(reactToToggle(checked)== 3)
wizard1->button(QWizard::NextButton)->setEnabled(true);
else
wizard1->button(QWizard::NextButton)->setDisabled(true);
}


but the compiler returns a SIGSEGV error, is there anything wrong with my implementation apart from the SIGSEGV exception???

wysota
12th September 2013, 13:32
Why didn't you use isComplete()?

pkjag
12th September 2013, 18:30
Ok thanks it worked.
Hey could you check out my earlier post, StudentQt was helping me with it but he kinda got stuck too
It's here:
http://www.qtcentre.org/threads/56164-how-to-create-column-headers-by-selecting-radiobuttons-and-checkboxes