Momergil
31st July 2013, 04:07
Hello!
I'm trying to write a QWizard with some QWizardPage s and I'm not being able to use the function registerField(...). The way I'm trying to implement this is as it's shown in the QtAssistant's QWizard page: I created some functions that return pointers to QWizardPage, and then add them with addPage() to an object created in my main() before my MainWindow.show().
To be more specific, the compiler rejects registerField(...) without object, and when I use the QWizardParge created inside those functions, it returns an error saying that registerField() is protected.
QWizardPage *createUserData()
{
QWizardPage *page = new QWizardPage;
page->setTitle("User data");
QLabel *label = new QLabel(QObject::tr("Please, fill the following spaces with your personal data."));
label->setWordWrap(true);
QLabel *spaceLabel = new QLabel("");
QLineEdit *LE_Username = new QLineEdit();
LE_Username->setPlaceholderText(QObject::tr("Fill your username here"));
LE_Username->setObjectName("LE_Username");
QLineEdit *LE_Undefined = new QLineEdit("");
LE_Undefined->setPlaceholderText(QObject::tr("<Nothing to be written here yet.>"));
registerField("LE_Username*",LE_Username); //Error: can't be used without object
page->registerField("LE_Username*",LE_Username); //Error: is protected
...
I'm glad for any help.
Momergil
I'm trying to write a QWizard with some QWizardPage s and I'm not being able to use the function registerField(...). The way I'm trying to implement this is as it's shown in the QtAssistant's QWizard page: I created some functions that return pointers to QWizardPage, and then add them with addPage() to an object created in my main() before my MainWindow.show().
To be more specific, the compiler rejects registerField(...) without object, and when I use the QWizardParge created inside those functions, it returns an error saying that registerField() is protected.
QWizardPage *createUserData()
{
QWizardPage *page = new QWizardPage;
page->setTitle("User data");
QLabel *label = new QLabel(QObject::tr("Please, fill the following spaces with your personal data."));
label->setWordWrap(true);
QLabel *spaceLabel = new QLabel("");
QLineEdit *LE_Username = new QLineEdit();
LE_Username->setPlaceholderText(QObject::tr("Fill your username here"));
LE_Username->setObjectName("LE_Username");
QLineEdit *LE_Undefined = new QLineEdit("");
LE_Undefined->setPlaceholderText(QObject::tr("<Nothing to be written here yet.>"));
registerField("LE_Username*",LE_Username); //Error: can't be used without object
page->registerField("LE_Username*",LE_Username); //Error: is protected
...
I'm glad for any help.
Momergil