[Qt-interest] QWizard: how to exchange a QStandardItemModel between pages ?

Andre Somers andre at familiesomers.nl
Tue Feb 16 09:08:48 CET 2010


Mario Signorino wrote:
> Hi all.
> I have a Qwizard. And in one of its page I build a QStandardItemModel*
> (3cols * X rows).
> How can I handle it? I need it at the end of the wizard.
> I don't like global pointers... And serializing it in a hidden widget
> seems stupid.
> Any hints?
> Tnx all
>
>   
Just create an API in your widget page to retreive the data or give 
access to the model itself? When setting up the wizard, you create the 
pages, so you have access to pointers to all pages. This allows you to 
hook them up in any way you want. You could even create a signal/slot 
connection between the pages that need to share data, if you want.

What I have also done, is create properties in the wizard page itself, 
and then registering them as fields in the QWizard. Works like a charm!

André





More information about the Qt-interest-old mailing list