Hello!

I'm trying to implement a QWizard in my software that should only appear in the first time it's initialized after installation. For that I'm trying to implement that QWizard in the easy way as first shown in the Qt Documentation regarding the QWizardclass.

The problem is that after the execution of the wizard, the config set by the user should be stored for that software using QSettings. So I was trying to figure out how could I take the QWizardPages' QLineEdit and etcs info so it could be stored and it seems the only possibile way is by using fields.

So tried to use it and I found the problem of using protected functions:

Qt Code:
  1. QWizardPage *createUserData()
  2. {
  3. QWizardPage *page = new QWizardPage;
  4. page->setTitle("User data");
  5.  
  6. QLabel *label = new QLabel("Fill the following spaces with your personal data.");
  7. label->setWordWrap(true);
  8.  
  9. QLabel *spaceLabel = new QLabel("");
  10.  
  11. QLineEdit *LE_Username = new QLineEdit();
  12. LE_Username->setPlaceholderText("Fill your username here");
  13. LE_Username->setObjectName("LE_Username");
  14.  
  15. QLineEdit *LE_Undefined = new QLineEdit("");
  16. LE_Undefined->setPlaceholderText("Nothing to be written here yet.");
  17.  
  18. registerField("LE_Username",LE_Username->window()); //Don't accept
  19.  
  20. QVBoxLayout *layout = new QVBoxLayout;
  21. layout->addWidget(label);
  22. layout->addWidget(spaceLabel);
  23. layout->addWidget(LE_Username);
  24. layout->addWidget(LE_Undefined);
  25. page->setLayout(layout);
  26.  
  27. return page;
  28. }
To copy to clipboard, switch view to plain text mode 

My question is: is there a way to do what I want without having to implement "classed" QWizardPage? If not, could you please give me a more comple example of how to do it? (I'm not sure if I actually understood how to implement it in accord to the Qt Documentation's example.

Thanks,

Momergil