Registering field in Qt designer created Wizard
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:
Code:
ui->page_1->registerField("test", ui->du_email_f);
and
Code:
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."
Re: Registering field in Qt designer created Wizard
This is a method of QWizardPage so it can only be called from the context of the page and not the wizard.
Re: Registering field in Qt designer created Wizard
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.
Re: Registering field in Qt designer created Wizard
Same problem here.
Quote:
Originally Posted by
wysota
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
Re: Registering field in Qt designer created Wizard
You can promote pages to custom classes and implement those classes in code.