summaryrefslogtreecommitdiffstats
path: root/doc/html/tqwizard.html
blob: de387312086a976117c42ba0263118d7648060a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/dialogs/tqwizard.cpp:55 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQWizard Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQWizard Class Reference</h1>

<p>The TQWizard class provides a framework for wizard dialogs.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="tqwizard-h.html">tqwizard.h</a>&gt;</tt>
<p>Inherits <a href="tqdialog.html">TQDialog</a>.
<p><a href="tqwizard-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQWizard"><b>TQWizard</b></a> ( TQWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )</li>
<li class=fn><a href="#~TQWizard"><b>~TQWizard</b></a> ()</li>
<li class=fn>virtual void <a href="#addPage"><b>addPage</b></a> ( TQWidget&nbsp;*&nbsp;page, const&nbsp;TQString&nbsp;&amp;&nbsp;title )</li>
<li class=fn>virtual void <a href="#insertPage"><b>insertPage</b></a> ( TQWidget&nbsp;*&nbsp;page, const&nbsp;TQString&nbsp;&amp;&nbsp;title, int&nbsp;index )</li>
<li class=fn>virtual void <a href="#removePage"><b>removePage</b></a> ( TQWidget&nbsp;*&nbsp;page )</li>
<li class=fn>TQString <a href="#title"><b>title</b></a> ( TQWidget&nbsp;*&nbsp;page ) const</li>
<li class=fn>void <a href="#setTitle"><b>setTitle</b></a> ( TQWidget&nbsp;*&nbsp;page, const&nbsp;TQString&nbsp;&amp;&nbsp;title )</li>
<li class=fn>TQFont <a href="#titleFont"><b>titleFont</b></a> () const</li>
<li class=fn>void <a href="#setTitleFont"><b>setTitleFont</b></a> ( const TQFont &amp; )</li>
<li class=fn>virtual void <a href="#showPage"><b>showPage</b></a> ( TQWidget&nbsp;*&nbsp;page )</li>
<li class=fn>TQWidget * <a href="#currentPage"><b>currentPage</b></a> () const</li>
<li class=fn>TQWidget * <a href="#page"><b>page</b></a> ( int&nbsp;index ) const</li>
<li class=fn>int <a href="#pageCount"><b>pageCount</b></a> () const</li>
<li class=fn>int <a href="#indexOf"><b>indexOf</b></a> ( TQWidget&nbsp;*&nbsp;page ) const</li>
<li class=fn>virtual bool <a href="#appropriate"><b>appropriate</b></a> ( TQWidget&nbsp;*&nbsp;page ) const</li>
<li class=fn>virtual void <a href="#setAppropriate"><b>setAppropriate</b></a> ( TQWidget&nbsp;*&nbsp;page, bool&nbsp;appropriate )</li>
<li class=fn>TQPushButton * <a href="#backButton"><b>backButton</b></a> () const</li>
<li class=fn>TQPushButton * <a href="#nextButton"><b>nextButton</b></a> () const</li>
<li class=fn>TQPushButton * <a href="#finishButton"><b>finishButton</b></a> () const</li>
<li class=fn>TQPushButton * <a href="#cancelButton"><b>cancelButton</b></a> () const</li>
<li class=fn>TQPushButton * <a href="#helpButton"><b>helpButton</b></a> () const</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>virtual void <a href="#setBackEnabled"><b>setBackEnabled</b></a> ( TQWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
<li class=fn>virtual void <a href="#setNextEnabled"><b>setNextEnabled</b></a> ( TQWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
<li class=fn>virtual void <a href="#setFinishEnabled"><b>setFinishEnabled</b></a> ( TQWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
<li class=fn>virtual void <a href="#setHelpEnabled"><b>setHelpEnabled</b></a> ( TQWidget&nbsp;*&nbsp;page, bool&nbsp;enable )</li>
<li class=fn>virtual void setFinish ( TQWidget *, bool ) &nbsp;<em>(obsolete)</em></li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#helpClicked"><b>helpClicked</b></a> ()</li>
<li class=fn>void <a href="#selected"><b>selected</b></a> ( const TQString &amp; )</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>TQFont <a href="#titleFont-prop"><b>titleFont</b></a>&nbsp;- the font used for page titles</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#layOutButtonRow"><b>layOutButtonRow</b></a> ( TQHBoxLayout&nbsp;*&nbsp;layout )</li>
<li class=fn>virtual void <a href="#layOutTitleRow"><b>layOutTitleRow</b></a> ( TQHBoxLayout&nbsp;*&nbsp;layout, const&nbsp;TQString&nbsp;&amp;&nbsp;title )</li>
</ul>
<h2>Protected Slots</h2>
<ul>
<li class=fn>virtual void <a href="#back"><b>back</b></a> ()</li>
<li class=fn>virtual void <a href="#next"><b>next</b></a> ()</li>
<li class=fn>virtual void <a href="#help"><b>help</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQWizard class provides a framework for wizard dialogs.
<p> 



<p> A wizard is a special type of input dialog that consists of a
sequence of dialog pages. A wizard's purpose is to walk the user
through a process step by step. Wizards are useful for complex or
infrequently occurring tasks that people may find difficult to
learn or do.
<p> TQWizard provides page titles and displays Next, Back, Finish,
Cancel, and Help push buttons, as appropriate to the current
position in the page sequence. These buttons can be
enabled/disabled using <a href="#setBackEnabled">setBackEnabled</a>(), <a href="#setNextEnabled">setNextEnabled</a>(),
<a href="#setFinishEnabled">setFinishEnabled</a>() and <a href="#setHelpEnabled">setHelpEnabled</a>().
<p> Create and populate dialog pages that inherit from <a href="tqwidget.html">TQWidget</a> and add
them to the wizard using <a href="#addPage">addPage</a>(). Use <a href="#insertPage">insertPage</a>() to add a
dialog page at a certain position in the page sequence. Use
<a href="#removePage">removePage</a>() to remove a page from the page sequence.
<p> Use <a href="#currentPage">currentPage</a>() to retrieve a pointer to the currently displayed
page. <a href="#page">page</a>() returns a pointer to the page at a certain position
in the page sequence.
<p> Use <a href="#pageCount">pageCount</a>() to retrieve the total number of pages in the page
sequence. <a href="#indexOf">indexOf</a>() will return the index of a page in the page
sequence.
<p> TQWizard provides functionality to mark pages as appropriate (or
not) in the current context with <a href="#setAppropriate">setAppropriate</a>(). The idea is
that a page may be irrelevant and should be skipped depending on
the data entered by the user on a preceding page.
<p> It is generally considered good design to provide a greater number
of simple pages with fewer choices rather than a smaller number of
complex pages.
<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>
<p> <center><img src="tqwizard.png" alt="A TQWizard page"></center> <blockquote><p align="center"><em> A TQWizard page
</em></p>
</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>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQWizard"></a>TQWizard::TQWizard ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, bool&nbsp;modal = FALSE, WFlags&nbsp;f = 0 )
</h3>
Constructs 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="tqdialog.html">TQDialog</a> constructor.

<h3 class=fn><a name="~TQWizard"></a>TQWizard::~TQWizard ()
</h3>
Destroys the object and frees any allocated resources, including
all pages and controllers.

<h3 class=fn>void <a name="addPage"></a>TQWizard::addPage ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;title )<tt> [virtual]</tt>
</h3>
Adds <em>page</em> to the end of the page sequence, with the title, <em>title</em>.

<h3 class=fn>bool <a name="appropriate"></a>TQWizard::appropriate ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page ) const<tt> [virtual]</tt>
</h3>
Called when the Next button is clicked; this virtual function
returns TRUE if <em>page</em> is relevant for display in the current
context; otherwise it is ignored by TQWizard and returns FALSE. The
default implementation returns the value set using
<a href="#setAppropriate">setAppropriate</a>(). The ultimate default is TRUE.
<p> <b>Warning:</b> The last page of the wizard will be displayed if no page
is relevant in the current context.

<h3 class=fn>void <a name="back"></a>TQWizard::back ()<tt> [virtual protected slot]</tt>
</h3>
Called when the user clicks the Back button; this function shows
the preceding relevant page in the sequence.
<p> <p>See also <a href="#appropriate">appropriate</a>().

<h3 class=fn><a href="tqpushbutton.html">TQPushButton</a>&nbsp;* <a name="backButton"></a>TQWizard::backButton () const
</h3>
Returns a pointer to the dialog's Back button
<p> By default, this button is connected to the <a href="#back">back</a>() slot, which is
virtual so you can reimplement it in a TQWizard subclass. Use
<a href="#setBackEnabled">setBackEnabled</a>() to enable/disable this button.

<h3 class=fn><a href="tqpushbutton.html">TQPushButton</a>&nbsp;* <a name="cancelButton"></a>TQWizard::cancelButton () const
</h3>
Returns a pointer to the dialog's Cancel button
<p> By default, this button is connected to the <a href="tqdialog.html#reject">TQDialog::reject</a>()
slot, which is virtual so you can reimplement it in a TQWizard
subclass.

<h3 class=fn><a href="tqwidget.html">TQWidget</a>&nbsp;* <a name="currentPage"></a>TQWizard::currentPage () const
</h3>
Returns a pointer to the current page in the sequence. Although
the wizard does its best to make sure that this value is never 0,
it can be if you try hard enough.

<h3 class=fn><a href="tqpushbutton.html">TQPushButton</a>&nbsp;* <a name="finishButton"></a>TQWizard::finishButton () const
</h3>
Returns a pointer to the dialog's Finish button
<p> By default, this button is connected to the <a href="tqdialog.html#accept">TQDialog::accept</a>()
slot, which is virtual so you can reimplement it in a TQWizard
subclass. Use <a href="#setFinishEnabled">setFinishEnabled</a>() to enable/disable this button.

<h3 class=fn>void <a name="help"></a>TQWizard::help ()<tt> [virtual protected slot]</tt>
</h3>
Called when the user clicks the Help button, this function emits
the <a href="#helpClicked">helpClicked</a>() signal.

<h3 class=fn><a href="tqpushbutton.html">TQPushButton</a>&nbsp;* <a name="helpButton"></a>TQWizard::helpButton () const
</h3>
Returns a pointer to the dialog's Help button
<p> By default, this button is connected to the <a href="#help">help</a>() slot, which is
virtual so you can reimplement it in a TQWizard subclass. Use
<a href="#setHelpEnabled">setHelpEnabled</a>() to enable/disable this button.

<h3 class=fn>void <a name="helpClicked"></a>TQWizard::helpClicked ()<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the user clicks on the Help button.

<h3 class=fn>int <a name="indexOf"></a>TQWizard::indexOf ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page ) const
</h3>
Returns the position of page <em>page</em>. If the page is not part of
the wizard -1 is returned.

<h3 class=fn>void <a name="insertPage"></a>TQWizard::insertPage ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;title, int&nbsp;index )<tt> [virtual]</tt>
</h3>
Inserts <em>page</em> at position <em>index</em> into the page sequence, with
title <em>title</em>. If <em>index</em> is -1, the page will be appended to
the end of the wizard's page sequence.

<h3 class=fn>void <a name="layOutButtonRow"></a>TQWizard::layOutButtonRow ( <a href="tqhboxlayout.html">TQHBoxLayout</a>&nbsp;*&nbsp;layout )<tt> [virtual protected]</tt>
</h3>
This virtual function is responsible for adding the buttons below
the bottom divider.
<p> <em>layout</em> is the horizontal layout of the entire wizard.

<h3 class=fn>void <a name="layOutTitleRow"></a>TQWizard::layOutTitleRow ( <a href="tqhboxlayout.html">TQHBoxLayout</a>&nbsp;*&nbsp;layout, const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;title )<tt> [virtual protected]</tt>
</h3>
This virtual function is responsible for laying out the title row.
<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
time <em>title</em> changes.

<h3 class=fn>void <a name="next"></a>TQWizard::next ()<tt> [virtual protected slot]</tt>
</h3>
Called when the user clicks the Next button, this function shows
the next relevant page in the sequence.
<p> <p>See also <a href="#appropriate">appropriate</a>().

<h3 class=fn><a href="tqpushbutton.html">TQPushButton</a>&nbsp;* <a name="nextButton"></a>TQWizard::nextButton () const
</h3>
Returns a pointer to the dialog's Next button
<p> By default, this button is connected to the <a href="#next">next</a>() slot, which is
virtual so you can reimplement it in a TQWizard subclass. Use
<a href="#setNextEnabled">setNextEnabled</a>() to enable/disable this button.

<h3 class=fn><a href="tqwidget.html">TQWidget</a>&nbsp;* <a name="page"></a>TQWizard::page ( int&nbsp;index ) const
</h3>
Returns a pointer to the page at position <em>index</em> in the
sequence, or 0 if <em>index</em> is out of range. The first page has
index 0.

<h3 class=fn>int <a name="pageCount"></a>TQWizard::pageCount () const
</h3>
Returns the number of pages in the wizard.

<h3 class=fn>void <a name="removePage"></a>TQWizard::removePage ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page )<tt> [virtual]</tt>
</h3>
Removes <em>page</em> from the page sequence but does not delete the
page. If <em>page</em> is currently being displayed, TQWizard will
display the page that precedes it, or the first page if this was
the first page.

<h3 class=fn>void <a name="selected"></a>TQWizard::selected ( const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp; )<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the current page changes. The
parameter contains the title of the selected page.

<h3 class=fn>void <a name="setAppropriate"></a>TQWizard::setAppropriate ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, bool&nbsp;appropriate )<tt> [virtual]</tt>
</h3>
If <em>appropriate</em> is TRUE then page <em>page</em> is considered relevant
in the current context and should be displayed in the page
sequence; otherwise <em>page</em> should not be displayed in the page
sequence.
<p> <p>See also <a href="#appropriate">appropriate</a>().

<h3 class=fn>void <a name="setBackEnabled"></a>TQWizard::setBackEnabled ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
</h3>
If <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.

<h3 class=fn>void <a name="setFinish"></a>TQWizard::setFinish ( <a href="tqwidget.html">TQWidget</a>&nbsp;*, bool )<tt> [virtual slot]</tt>
</h3>

<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Use setFinishEnabled instead

<h3 class=fn>void <a name="setFinishEnabled"></a>TQWizard::setFinishEnabled ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
</h3>
If <em>enable</em> is TRUE, page <em>page</em> has a Finish button; otherwise
<em>page</em> has no Finish button. By default <em>no</em> page has this
button.

<h3 class=fn>void <a name="setHelpEnabled"></a>TQWizard::setHelpEnabled ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
</h3>
If <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.

<h3 class=fn>void <a name="setNextEnabled"></a>TQWizard::setNextEnabled ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, bool&nbsp;enable )<tt> [virtual slot]</tt>
</h3>
If <em>enable</em> is TRUE, page <em>page</em> has a Next button; otherwise
the Next button on <em>page</em> is disabled. By default all pages have
this button.

<h3 class=fn>void <a name="setTitle"></a>TQWizard::setTitle ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page, const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;title )
</h3>
Sets the title for page <em>page</em> to <em>title</em>.

<h3 class=fn>void <a name="setTitleFont"></a>TQWizard::setTitleFont ( const&nbsp;<a href="tqfont.html">TQFont</a>&nbsp;&amp; )
</h3><p>Sets the font used for page titles.
See the <a href="tqwizard.html#titleFont-prop">"titleFont"</a> property for details.
<h3 class=fn>void <a name="showPage"></a>TQWizard::showPage ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page )<tt> [virtual]</tt>
</h3>
Makes <em>page</em> the current page and emits the <a href="#selected">selected</a>() signal.
<p> This virtual function is called whenever a different page is to
be shown, including the first time the TQWizard is shown.
By reimplementing it (and calling <a href="#showPage">TQWizard::showPage</a>()),
you can prepare each page prior to it being shown.

<p>Examples: <a href="distributor-example.html#x2673">distributor/distributor.ui.h</a> and <a href="wizard-example.html#x15">wizard/wizard.cpp</a>.
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="title"></a>TQWizard::title ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;page ) const
</h3>
Returns the title of page <em>page</em>.

<h3 class=fn><a href="tqfont.html">TQFont</a> <a name="titleFont"></a>TQWizard::titleFont () const
</h3><p>Returns the font used for page titles.
See the <a href="tqwizard.html#titleFont-prop">"titleFont"</a> property for details.
<hr><h2>Property Documentation</h2>
<h3 class=fn><a href="tqfont.html">TQFont</a> <a name="titleFont-prop"></a>titleFont</h3>
<p>This property holds the font used for page titles.
<p>The default is <a href="ntqapplication.html#font">TQApplication::font</a>().

<p>Set this property's value with <a href="#setTitleFont">setTitleFont</a>() and get this property's value with <a href="#titleFont">titleFont</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>