RFC: KWizard

Olivier Goffart ogoffart at kde.org
Fri Aug 4 10:09:55 BST 2006


Le vendredi 4 août 2006 09:23, Thomas Zander a écrit :
> On Thursday 3 August 2006 23:17, Olivier Goffart wrote:
> > About appropriate, i was about to add it because it was in Q3Wizard,
> >  but i don't know the sens of it.
>
> Reading the source I think you missed it indeed :)
>
> If you have, say, 10 pages in a wizard and the first page has a
> buttongroup of 3 choices then choosing different values may mean that the
> page sequence changes.
> For example see these page sequences;   option a:  1, 4, 5
> option b: 1, 2, 3, 10
> option c:  1, 6, 7, 8, 9, 10

ok, I've added the way to use appropriate.

> This means that on 'next' you need to be able to read the data from the
> GUI and update the 'appropriate' settings before the wizard actually
> chooses which page to show next.
>
> Therefor I suggested the protected hook:
>     virtual void  leavingPage(QWidget *from, bool usingNext);
> Which allow you to do this nicely by reading the data from the widget and
> updating the wizard state accordingly.

There is already virtual next(). the currentPage() method let you know which 
widget we are leaving. 
And you can call KWizard::next() only if the content of the page is correct.

> Due to the fact that in this scenario I don't want all pages to actually
> show it would be a good idea to have:
>     virtual void enteringPage(QWidget *to, bool usingNext);
> which can initialize the page with all the currently relevant data. In
> case some expensive action is required to actually fill the widget see
> the anti-spam-wizard in kmail for example) this is the right place to
> initialize that process.

There is also a signal which is emit when the page change. You can make a slot 
that do exactly this.

> Last;
>     virtual void leavingWizard(bool successfull);
> this method is very usefull to process the data.  Especially using the
> bool value. Pressing cancel will call this method and pressing finish
> will also.

there is already the  virtual done(int result)  from QDialog,  and also 
accept() and reject() 
+ one signal for each of theses 3 functions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060804/affdf2e9/attachment.sig>


More information about the kde-core-devel mailing list