source: trunk/doc/html/qwizard.html@ 203

Last change on this file since 203 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 19.1 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/dialogs/qwizard.cpp:55 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QWizard Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QWizard Class Reference</h1>
33
34<p>The QWizard class provides a framework for wizard dialogs.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qwizard-h.html">qwizard.h</a>&gt;</tt>
37<p>Inherits <a href="qdialog.html">QDialog</a>.
38<p><a href="qwizard-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QWizard"><b>QWizard</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )</li>
42<li class=fn><a href="#~QWizard"><b>~QWizard</b></a> ()</li>
43<li class=fn>virtual void <a href="#addPage"><b>addPage</b></a> ( QWidget&nbsp;*&nbsp;page, const&nbsp;QString&nbsp;&amp;&nbsp;title )</li>
44<li class=fn>virtual void <a href="#insertPage"><b>insertPage</b></a> ( QWidget&nbsp;*&nbsp;page, const&nbsp;QString&nbsp;&amp;&nbsp;title, int&nbsp;index )</li>
45<li class=fn>virtual void <a href="#removePage"><b>removePage</b></a> ( QWidget&nbsp;*&nbsp;page )</li>
46<li class=fn>QString <a href="#title"><b>title</b></a> ( QWidget&nbsp;*&nbsp;page ) const</li>
47<li class=fn>void <a href="#setTitle"><b>setTitle</b></a> ( QWidget&nbsp;*&nbsp;page, const&nbsp;QString&nbsp;&amp;&nbsp;title )</li>
48<li class=fn>QFont <a href="#titleFont"><b>titleFont</b></a> () const</li>
49<li class=fn>void <a href="#setTitleFont"><b>setTitleFont</b></a> ( const QFont &amp; )</li>
50<li class=fn>virtual void <a href="#showPage"><b>showPage</b></a> ( QWidget&nbsp;*&nbsp;page )</li>
51<li class=fn>QWidget * <a href="#currentPage"><b>currentPage</b></a> () const</li>
52<li class=fn>QWidget * <a href="#page"><b>page</b></a> ( int&nbsp;index ) const</li>
53<li class=fn>int <a href="#pageCount"><b>pageCount</b></a> () const</li>
54<li class=fn>int <a href="#indexOf"><b>indexOf</b></a> ( QWidget&nbsp;*&nbsp;page ) const</li>
55<li class=fn>virtual bool <a href="#appropriate"><b>appropriate</b></a> ( QWidget&nbsp;*&nbsp;page ) const</li>
56<li class=fn>virtual void <a href="#setAppropriate"><b>setAppropriate</b></a> ( QWidget&nbsp;*&nbsp;page, bool&nbsp;appropriate )</li>
57<li class=fn>QPushButton * <a href="#backButton"><b>backButton</b></a> () const</li>
58<li class=fn>QPushButton * <a href="#nextButton"><b>nextButton</b></a> () const</li>
59<li class=fn>QPushButton * <a href="#finishButton"><b>finishButton</b></a> () const</li>
60<li class=fn>QPushButton * <a href="#cancelButton"><b>cancelButton</b></a> () const</li>
61<li class=fn>QPushButton * <a href="#helpButton"><b>helpButton</b></a> () const</li>
62</ul>
63<h2>Public Slots</h2>
64<ul>
65<li class=fn>virtual void <a href="#setBackEnabled"><b>setBackEnabled</b></a> ( QWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
66<li class=fn>virtual void <a href="#setNextEnabled"><b>setNextEnabled</b></a> ( QWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
67<li class=fn>virtual void <a href="#setFinishEnabled"><b>setFinishEnabled</b></a> ( QWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
68<li class=fn>virtual void <a href="#setHelpEnabled"><b>setHelpEnabled</b></a> ( QWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
69<li class=fn>virtual void setFinish ( QWidget *, bool ) &nbsp;<em>(obsolete)</em></li>
70</ul>
71<h2>Signals</h2>
72<ul>
73<li class=fn>void <a href="#helpClicked"><b>helpClicked</b></a> ()</li>
74<li class=fn>void <a href="#selected"><b>selected</b></a> ( const QString &amp; )</li>
75</ul>
76<h2>Properties</h2>
77<ul>
78<li class=fn>QFont <a href="#titleFont-prop"><b>titleFont</b></a>&nbsp;- the font used for page titles</li>
79</ul>
80<h2>Protected Members</h2>
81<ul>
82<li class=fn>virtual void <a href="#layOutButtonRow"><b>layOutButtonRow</b></a> ( QHBoxLayout&nbsp;*&nbsp;layout )</li>
83<li class=fn>virtual void <a href="#layOutTitleRow"><b>layOutTitleRow</b></a> ( QHBoxLayout&nbsp;*&nbsp;layout, const&nbsp;QString&nbsp;&amp;&nbsp;title )</li>
84</ul>
85<h2>Protected Slots</h2>
86<ul>
87<li class=fn>virtual void <a href="#back"><b>back</b></a> ()</li>
88<li class=fn>virtual void <a href="#next"><b>next</b></a> ()</li>
89<li class=fn>virtual void <a href="#help"><b>help</b></a> ()</li>
90</ul>
91<hr><a name="details"></a><h2>Detailed Description</h2>
92
93
94The QWizard class provides a framework for wizard dialogs.
95<p>
96
97
98
99<p> A wizard is a special type of input dialog that consists of a
100sequence of dialog pages. A wizard's purpose is to walk the user
101through a process step by step. Wizards are useful for complex or
102infrequently occurring tasks that people may find difficult to
103learn or do.
104<p> QWizard provides page titles and displays Next, Back, Finish,
105Cancel, and Help push buttons, as appropriate to the current
106position in the page sequence. These buttons can be
107enabled/disabled using <a href="#setBackEnabled">setBackEnabled</a>(), <a href="#setNextEnabled">setNextEnabled</a>(),
108<a href="#setFinishEnabled">setFinishEnabled</a>() and <a href="#setHelpEnabled">setHelpEnabled</a>().
109<p> Create and populate dialog pages that inherit from <a href="qwidget.html">QWidget</a> and add
110them to the wizard using <a href="#addPage">addPage</a>(). Use <a href="#insertPage">insertPage</a>() to add a
111dialog page at a certain position in the page sequence. Use
112<a href="#removePage">removePage</a>() to remove a page from the page sequence.
113<p> Use <a href="#currentPage">currentPage</a>() to retrieve a pointer to the currently displayed
114page. <a href="#page">page</a>() returns a pointer to the page at a certain position
115in the page sequence.
116<p> Use <a href="#pageCount">pageCount</a>() to retrieve the total number of pages in the page
117sequence. <a href="#indexOf">indexOf</a>() will return the index of a page in the page
118sequence.
119<p> QWizard provides functionality to mark pages as appropriate (or
120not) in the current context with <a href="#setAppropriate">setAppropriate</a>(). The idea is
121that a page may be irrelevant and should be skipped depending on
122the data entered by the user on a preceding page.
123<p> It is generally considered good design to provide a greater number
124of simple pages with fewer choices rather than a smaller number of
125complex pages.
126<p> Example code is available here: <a href="wizard-wizard-cpp.html">wizard/wizard.cpp</a> <a href="wizard-wizard-h.html">wizard/wizard.h</a>
127<p> <center><img src="qwizard.png" alt="A QWizard page"></center> <blockquote><p align="center"><em> A QWizard page
128</em></p>
129</blockquote><p> <p>See also <a href="abstractwidgets.html">Abstract Widget Classes</a>, <a href="dialogs.html">Dialog Classes</a>, and <a href="organizers.html">Organizers</a>.
130
131<hr><h2>Member Function Documentation</h2>
132<h3 class=fn><a name="QWizard"></a>QWizard::QWizard ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )
133</h3>
134Constructs an empty wizard dialog. The <em>parent</em>, <em>name</em>, <em>modal</em> and <em>f</em> arguments are passed to the <a href="qdialog.html">QDialog</a> constructor.
135
136<h3 class=fn><a name="~QWizard"></a>QWizard::~QWizard ()
137</h3>
138Destroys the object and frees any allocated resources, including
139all pages and controllers.
140
141<h3 class=fn>void <a name="addPage"></a>QWizard::addPage ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;title )<tt> [virtual]</tt>
142</h3>
143Adds <em>page</em> to the end of the page sequence, with the title, <em>title</em>.
144
145<h3 class=fn>bool <a name="appropriate"></a>QWizard::appropriate ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page ) const<tt> [virtual]</tt>
146</h3>
147Called when the Next button is clicked; this virtual function
148returns TRUE if <em>page</em> is relevant for display in the current
149context; otherwise it is ignored by QWizard and returns FALSE. The
150default implementation returns the value set using
151<a href="#setAppropriate">setAppropriate</a>(). The ultimate default is TRUE.
152<p> <b>Warning:</b> The last page of the wizard will be displayed if no page
153is relevant in the current context.
154
155<h3 class=fn>void <a name="back"></a>QWizard::back ()<tt> [virtual protected slot]</tt>
156</h3>
157Called when the user clicks the Back button; this function shows
158the preceding relevant page in the sequence.
159<p> <p>See also <a href="#appropriate">appropriate</a>().
160
161<h3 class=fn><a href="qpushbutton.html">QPushButton</a>&nbsp;* <a name="backButton"></a>QWizard::backButton () const
162</h3>
163Returns a pointer to the dialog's Back button
164<p> By default, this button is connected to the <a href="#back">back</a>() slot, which is
165virtual so you can reimplement it in a QWizard subclass. Use
166<a href="#setBackEnabled">setBackEnabled</a>() to enable/disable this button.
167
168<h3 class=fn><a href="qpushbutton.html">QPushButton</a>&nbsp;* <a name="cancelButton"></a>QWizard::cancelButton () const
169</h3>
170Returns a pointer to the dialog's Cancel button
171<p> By default, this button is connected to the <a href="qdialog.html#reject">QDialog::reject</a>()
172slot, which is virtual so you can reimplement it in a QWizard
173subclass.
174
175<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="currentPage"></a>QWizard::currentPage () const
176</h3>
177Returns a pointer to the current page in the sequence. Although
178the wizard does its best to make sure that this value is never 0,
179it can be if you try hard enough.
180
181<h3 class=fn><a href="qpushbutton.html">QPushButton</a>&nbsp;* <a name="finishButton"></a>QWizard::finishButton () const
182</h3>
183Returns a pointer to the dialog's Finish button
184<p> By default, this button is connected to the <a href="qdialog.html#accept">QDialog::accept</a>()
185slot, which is virtual so you can reimplement it in a QWizard
186subclass. Use <a href="#setFinishEnabled">setFinishEnabled</a>() to enable/disable this button.
187
188<h3 class=fn>void <a name="help"></a>QWizard::help ()<tt> [virtual protected slot]</tt>
189</h3>
190Called when the user clicks the Help button, this function emits
191the <a href="#helpClicked">helpClicked</a>() signal.
192
193<h3 class=fn><a href="qpushbutton.html">QPushButton</a>&nbsp;* <a name="helpButton"></a>QWizard::helpButton () const
194</h3>
195Returns a pointer to the dialog's Help button
196<p> By default, this button is connected to the <a href="#help">help</a>() slot, which is
197virtual so you can reimplement it in a QWizard subclass. Use
198<a href="#setHelpEnabled">setHelpEnabled</a>() to enable/disable this button.
199
200<h3 class=fn>void <a name="helpClicked"></a>QWizard::helpClicked ()<tt> [signal]</tt>
201</h3>
202
203<p> This signal is emitted when the user clicks on the Help button.
204
205<h3 class=fn>int <a name="indexOf"></a>QWizard::indexOf ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page ) const
206</h3>
207Returns the position of page <em>page</em>. If the page is not part of
208the wizard -1 is returned.
209
210<h3 class=fn>void <a name="insertPage"></a>QWizard::insertPage ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;title, int&nbsp;index )<tt> [virtual]</tt>
211</h3>
212Inserts <em>page</em> at position <em>index</em> into the page sequence, with
213title <em>title</em>. If <em>index</em> is -1, the page will be appended to
214the end of the wizard's page sequence.
215
216<h3 class=fn>void <a name="layOutButtonRow"></a>QWizard::layOutButtonRow ( <a href="qhboxlayout.html">QHBoxLayout</a>&nbsp;*&nbsp;layout )<tt> [virtual protected]</tt>
217</h3>
218This virtual function is responsible for adding the buttons below
219the bottom divider.
220<p> <em>layout</em> is the horizontal layout of the entire wizard.
221
222<h3 class=fn>void <a name="layOutTitleRow"></a>QWizard::layOutTitleRow ( <a href="qhboxlayout.html">QHBoxLayout</a>&nbsp;*&nbsp;layout, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;title )<tt> [virtual protected]</tt>
223</h3>
224This virtual function is responsible for laying out the title row.
225<p> <em>layout</em> is the horizontal layout for the wizard, and <em>title</em> is the title for this page. This function is called every
226time <em>title</em> changes.
227
228<h3 class=fn>void <a name="next"></a>QWizard::next ()<tt> [virtual protected slot]</tt>
229</h3>
230Called when the user clicks the Next button, this function shows
231the next relevant page in the sequence.
232<p> <p>See also <a href="#appropriate">appropriate</a>().
233
234<h3 class=fn><a href="qpushbutton.html">QPushButton</a>&nbsp;* <a name="nextButton"></a>QWizard::nextButton () const
235</h3>
236Returns a pointer to the dialog's Next button
237<p> By default, this button is connected to the <a href="#next">next</a>() slot, which is
238virtual so you can reimplement it in a QWizard subclass. Use
239<a href="#setNextEnabled">setNextEnabled</a>() to enable/disable this button.
240
241<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="page"></a>QWizard::page ( int&nbsp;index ) const
242</h3>
243Returns a pointer to the page at position <em>index</em> in the
244sequence, or 0 if <em>index</em> is out of range. The first page has
245index 0.
246
247<h3 class=fn>int <a name="pageCount"></a>QWizard::pageCount () const
248</h3>
249Returns the number of pages in the wizard.
250
251<h3 class=fn>void <a name="removePage"></a>QWizard::removePage ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page )<tt> [virtual]</tt>
252</h3>
253Removes <em>page</em> from the page sequence but does not delete the
254page. If <em>page</em> is currently being displayed, QWizard will
255display the page that precedes it, or the first page if this was
256the first page.
257
258<h3 class=fn>void <a name="selected"></a>QWizard::selected ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp; )<tt> [signal]</tt>
259</h3>
260
261<p> This signal is emitted when the current page changes. The
262parameter contains the title of the selected page.
263
264<h3 class=fn>void <a name="setAppropriate"></a>QWizard::setAppropriate ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, bool&nbsp;appropriate )<tt> [virtual]</tt>
265</h3>
266If <em>appropriate</em> is TRUE then page <em>page</em> is considered relevant
267in the current context and should be displayed in the page
268sequence; otherwise <em>page</em> should not be displayed in the page
269sequence.
270<p> <p>See also <a href="#appropriate">appropriate</a>().
271
272<h3 class=fn>void <a name="setBackEnabled"></a>QWizard::setBackEnabled ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
273</h3>
274If <em>enable</em> is TRUE, page <em>page</em> has a Back button; otherwise <em>page</em> has no Back button. By default all pages have this button.
275
276<h3 class=fn>void <a name="setFinish"></a>QWizard::setFinish ( <a href="qwidget.html">QWidget</a>&nbsp;*, bool )<tt> [virtual slot]</tt>
277</h3>
278
279<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
280<p> Use setFinishEnabled instead
281
282<h3 class=fn>void <a name="setFinishEnabled"></a>QWizard::setFinishEnabled ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
283</h3>
284If <em>enable</em> is TRUE, page <em>page</em> has a Finish button; otherwise
285<em>page</em> has no Finish button. By default <em>no</em> page has this
286button.
287
288<h3 class=fn>void <a name="setHelpEnabled"></a>QWizard::setHelpEnabled ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
289</h3>
290If <em>enable</em> is TRUE, page <em>page</em> has a Help button; otherwise <em>page</em> has no Help button. By default all pages have this button.
291
292<h3 class=fn>void <a name="setNextEnabled"></a>QWizard::setNextEnabled ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
293</h3>
294If <em>enable</em> is TRUE, page <em>page</em> has a Next button; otherwise
295the Next button on <em>page</em> is disabled. By default all pages have
296this button.
297
298<h3 class=fn>void <a name="setTitle"></a>QWizard::setTitle ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;title )
299</h3>
300Sets the title for page <em>page</em> to <em>title</em>.
301
302<h3 class=fn>void <a name="setTitleFont"></a>QWizard::setTitleFont ( const&nbsp;<a href="qfont.html">QFont</a>&nbsp;&amp; )
303</h3><p>Sets the font used for page titles.
304See the <a href="qwizard.html#titleFont-prop">"titleFont"</a> property for details.
305<h3 class=fn>void <a name="showPage"></a>QWizard::showPage ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page )<tt> [virtual]</tt>
306</h3>
307Makes <em>page</em> the current page and emits the <a href="#selected">selected</a>() signal.
308<p> This virtual function is called whenever a different page is to
309be shown, including the first time the QWizard is shown.
310By reimplementing it (and calling <a href="#showPage">QWizard::showPage</a>()),
311you can prepare each page prior to it being shown.
312
313<p>Examples: <a href="distributor-example.html#x2673">distributor/distributor.ui.h</a> and <a href="wizard-example.html#x15">wizard/wizard.cpp</a>.
314<h3 class=fn><a href="qstring.html">QString</a> <a name="title"></a>QWizard::title ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;page ) const
315</h3>
316Returns the title of page <em>page</em>.
317
318<h3 class=fn><a href="qfont.html">QFont</a> <a name="titleFont"></a>QWizard::titleFont () const
319</h3><p>Returns the font used for page titles.
320See the <a href="qwizard.html#titleFont-prop">"titleFont"</a> property for details.
321<hr><h2>Property Documentation</h2>
322<h3 class=fn><a href="qfont.html">QFont</a> <a name="titleFont-prop"></a>titleFont</h3>
323<p>This property holds the font used for page titles.
324<p>The default is <a href="qapplication.html#font">QApplication::font</a>().
325
326<p>Set this property's value with <a href="#setTitleFont">setTitleFont</a>() and get this property's value with <a href="#titleFont">titleFont</a>().
327<!-- eof -->
328<hr><p>
329This file is part of the <a href="index.html">Qt toolkit</a>.
330Copyright &copy; 1995-2007
331<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
332<table width=100% cellspacing=0 border=0><tr>
333<td>Copyright &copy; 2007
334<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
335<td align=right><div align=right>Qt 3.3.8</div>
336</table></div></address></body>
337</html>
Note: See TracBrowser for help on using the repository browser.