Hi,
I have a similar question regarding registerField(). I have implemented a class ComponentsPage that inherits from QWizardPage (see code below).
ComponentsPage
::ComponentsPage(QWidget *parent
) : QWizardPage(parent)
{
// Set Titles
// [...]
// Create Check Boxes
// [...]
// Create Line Edit
// Register Field
registerField("test", lineTest);
// Set Layout
// [...]
}
int ComponentsPage::nextId() const
{
if (customCheck->isChecked())
return NewWizard::Page_Custom;
else
return NewWizard::Page_Finish;
}
ComponentsPage::ComponentsPage(QWidget *parent)
: QWizardPage(parent)
{
// Set Titles
// [...]
// Create Check Boxes
// [...]
customCheck = new QCheckBox(tr("Custom"));
// Create Line Edit
lineTest = new QLineEdit();
// Register Field
registerField("test", lineTest);
// Set Layout
// [...]
}
int ComponentsPage::nextId() const
{
if (customCheck->isChecked())
return NewWizard::Page_Custom;
else
return NewWizard::Page_Finish;
}
To copy to clipboard, switch view to plain text mode
However if I register my QLineEdit using the registerField method and try to access it on the next page (another subclass of QWizardPage) an empty string is returned.
CustomPage
::CustomPage(QWidget *parent
) : QWizardPage(parent)
{
// Set Titles
// [...]
// Access Field
QString hw
= field
("test").
toString();
// Show String
// Set Layout
// [...]
}
CustomPage::CustomPage(QWidget *parent)
: QWizardPage(parent)
{
// Set Titles
// [...]
// Access Field
QString hw = field("test").toString();
// Show String
testLabel = new QLabel (hw);
// Set Layout
// [...]
}
To copy to clipboard, switch view to plain text mode
What did I get wrong? I would be grateful for any help!
Thanks,
Tara
Bookmarks