I am using a set of QWizardPage classes within a QWizard. Separate to this I have a login dialog that takes information and reads from a database. This database information is then stored within a struct I have created.
I want to avoid tight-coupling and global data (and correspondingly Singletons) if I can as I want to try and carry out things in the best way.
Now firstly I currently create the wizard during the initialisation of the application and use a signal/slot to sent the struct to the wizard. This of course means that the wizard has to exist when I create the login form. The other way I suppose is to add a public function to the wizard or update the constructor. But that then means I need to pass the data along into the wizard pages as I create them. Is there a better way to do that, maybe along the lines of the associated part to this question:
The other thing is that I read information from the database at certain stages during the wizard. If you use registerField() it seems a nice way to do this but the information I have read from the database is not stored in a widget so I cannot see how to access this data from other pages. Is there a way to do this?
Many thanks
There is probably a better way to do this but what I dound was that i can create properties in my code and then use
registerFieldagainst those. The example here is very simple but by doing this I can register against anything I needed. I think if you start having more complicated properties that aren’t the “normal” types then it might well get a bit more complicated.Then in the code: