PDA

View Full Version : Writting Simple exam engine using Trivial Wizard Example



Blaxxton
7th May 2012, 08:05
Hi

I am newbie in Qt programming and trying to write a simple exam engine using
Trivial Wizard Example. All is working fine unless the QRadioButton::isChecked
won't work at QWizardPage. I have tried to turn Exclusivity to on and off and
checked all radio buttons off as well in QWizardPage but that didn't help.

I think I should change the isChecked status after adding QWizardPages to QWizard
and in main function but don't know how.

Could some please check the attached source code and let me know where I am doing wrong
or where and how should I check the QRadioButton status ?

ofcource if I place setChecked at QWizardPage level , it works, but now when I click
on QRadioButton.

Thanks for help

Blaxxton
8th May 2012, 11:30
Ok, QRadioButton's status should be checked when Next button is clicked
and I was checking the status when the QWizardPage was added to the QWizard.

now , how can we override the QWizard's next button to check the
QRadio button status of each page ? and if we can not over ride the
Next button , then we should be able to connect each next button
to a QWizardpage and it's QRadioButton's field , and I came up
with some thing like:

wizard.button(QWizard::NextButton)->connect(wizard.button(QWizard::NextButton), SIGNAL(clicked()), wizard.currentPage()->field(QRadioButton) ,SLOT(wizard.currentPage()->?));

but still don't know if I can use QRadioButton in field ,and what should I use beside of ? mark.

Thanks for help.

ChrisW67
8th May 2012, 23:49
When do you want to check that the correct answer has been checked? Can the user progress if they have the wrong answer or will they be blocked? Is the idea that you simply collect their response for each page and tally up the correct responses when they "Finish" the wizard?

You should look at how the QWizardPages are constructed in the Class Wizard Example because you could learn more from that than the trivial example.