PDA

View Full Version : Registering field in Qt designer created Wizard



quain
5th December 2010, 17:45
Hello.

I have created a simple wizard for testing purpose. It has two pages with one QLineEdit field (du_email_f and du_name) on each one.
My question is how do i register field?

i have already tried:

ui->page_1->registerField("test", ui->du_email_f);
and

this->page(0)->registerField("test", ui->du_email_f);
Both lines were placed in main wizard clas file in constructor (not at the same time ofc.)
In both cases i get "248: error: 'void QWizardPage::registerField(const QString&, QWidget*, const char*, const char*)' is protected within this context."

wysota
5th December 2010, 17:55
This is a method of QWizardPage so it can only be called from the context of the page and not the wizard.

quain
5th December 2010, 18:27
Thanks for fast answer.
Well, ill stick to my current method: Designing separated wizard pages and combinig them in no-ui wizard class.

Thanks for you time Wysota.

PhilippM
8th April 2011, 21:35
Same problem here.


This is a method of QWizardPage so it can only be called from the context of the page and not the wizard.

Well that is obvious.
But how is one supposed to set mandatory fields at all, when using the designer?
You can't access the QWizardPages instances in code, because the code is auto-generated by the designer. If you put the code in there, it is lost the next time uic is run.

If you can't modify the QWizardPages then a designer for QWizardPages is pointless, or am I missing something here?

Regards,
Philipp

wysota
8th April 2011, 22:17
You can promote pages to custom classes and implement those classes in code.