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
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- classwizard.qdoc -->
<title>Qt 4.8: Class Wizard Example</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="all-examples.html">Examples</a></li>
<li>Class Wizard Example</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#classwizard-class-definition">ClassWizard Class Definition</a></li>
<li class="level1"><a href="#the-classwizard-class">The ClassWizard Class</a></li>
<li class="level1"><a href="#the-intropage-class">The IntroPage Class</a></li>
<li class="level1"><a href="#the-classinfopage-class">The ClassInfoPage Class</a></li>
<li class="level1"><a href="#the-codestylepage-class">The CodeStylePage Class</a></li>
</ul>
</div>
<h1 class="title">Class Wizard Example</h1>
<span class="subtitle"></span>
<!-- $$$dialogs/classwizard-description -->
<div class="descr"> <a name="details"></a>
<p>Files:</p>
<ul>
<li><a href="dialogs-classwizard-classwizard-cpp.html">dialogs/classwizard/classwizard.cpp</a></li>
<li><a href="dialogs-classwizard-classwizard-h.html">dialogs/classwizard/classwizard.h</a></li>
<li><a href="dialogs-classwizard-main-cpp.html">dialogs/classwizard/main.cpp</a></li>
<li><a href="dialogs-classwizard-classwizard-pro.html">dialogs/classwizard/classwizard.pro</a></li>
<li><a href="dialogs-classwizard-classwizard-qrc.html">dialogs/classwizard/classwizard.qrc</a></li>
</ul>
<p>Images:</p>
<ul>
<li><a href="images/used-in-examples/dialogs/classwizard/images/background.png">dialogs/classwizard/images/background.png</a></li>
<li><a href="images/used-in-examples/dialogs/classwizard/images/banner.png">dialogs/classwizard/images/banner.png</a></li>
<li><a href="images/used-in-examples/dialogs/classwizard/images/logo1.png">dialogs/classwizard/images/logo1.png</a></li>
<li><a href="images/used-in-examples/dialogs/classwizard/images/logo2.png">dialogs/classwizard/images/logo2.png</a></li>
<li><a href="images/used-in-examples/dialogs/classwizard/images/logo3.png">dialogs/classwizard/images/logo3.png</a></li>
<li><a href="images/used-in-examples/dialogs/classwizard/images/watermark1.png">dialogs/classwizard/images/watermark1.png</a></li>
<li><a href="images/used-in-examples/dialogs/classwizard/images/watermark2.png">dialogs/classwizard/images/watermark2.png</a></li>
</ul>
<p>The License Wizard example shows how to implement linear wizards using <a href="qwizard.html">QWizard</a>.<p class="centerAlign"><img src="images/classwizard.png" alt="Screenshot of the Class Wizard example" /></p><p>Most wizards have a linear structure, with page 1 followed by page 2 and so on until the last page. Some wizards are more complex in that they allow different traversal paths based on the information provided by the user. The <a href="dialogs-licensewizard.html">License Wizard</a> example shows how to create such wizards.</p>
<p>The Class Wizard example consists of the following classes:</p>
<ul>
<li><tt>ClassWizard</tt> inherits <a href="qwizard.html">QWizard</a> and provides a three-step wizard that generates the skeleton of a C++ class based on the user's input.</li>
<li><tt>IntroPage</tt>, <tt>ClassInfoPage</tt>, <tt>CodeStylePage</tt>, <tt>OutputFilesPage</tt>, and <tt>ConclusionPage</tt> are <a href="qwizardpage.html">QWizardPage</a> subclasses that implement the wizard pages.</li>
</ul>
<a name="classwizard-class-definition"></a>
<h2>ClassWizard Class Definition</h2>
<p class="centerAlign"><img src="images/classwizard-flow.png" alt="The Class Wizard pages" /></p><p>We will see how to subclass <a href="qwizard.html">QWizard</a> to implement our own wizard. The concrete wizard class is called <tt>ClassWizard</tt> and provides five pages:</p>
<ul>
<li>The first page is an introduction page, telling the user what the wizard is going to do.</li>
<li>The second page asks for a class name and a base class, and allows the user to specify whether the class should have a <tt>Q_OBJECT</tt> macro and what constructors it should provide.</li>
<li>The third page allows the user to set some options related to the code style, such as the macro used to protect the header file from multiple inclusion (e.g., <tt>MYDIALOG_H</tt>).</li>
<li>The fourth page allows the user to specify the names of the output files.</li>
<li>The fifth page is a conclusion page.</li>
</ul>
<p>Although the program is just an example, if you press <b>Finish</b> (<b>Done</b> on Mac OS X), actual C++ source files will actually be generated.</p>
<a name="the-classwizard-class"></a>
<h2>The ClassWizard Class</h2>
<p>Here's the <tt>ClassWizard</tt> definition:</p>
<pre class="cpp"> <span class="keyword">class</span> ClassWizard : <span class="keyword">public</span> <span class="type"><a href="qwizard.html">QWizard</a></span>
{
Q_OBJECT
<span class="keyword">public</span>:
ClassWizard(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
<span class="type">void</span> accept();
};</pre>
<p>The class reimplements <a href="qdialog.html">QDialog</a>'s <a href="qdialog.html#accept">accept()</a> slot. This slot is called when the user clicks <b>Finish</b>.</p>
<p>Here's the constructor:</p>
<pre class="cpp"> ClassWizard<span class="operator">::</span>ClassWizard(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
: <span class="type"><a href="qwizard.html">QWizard</a></span>(parent)
{
addPage(<span class="keyword">new</span> IntroPage);
addPage(<span class="keyword">new</span> ClassInfoPage);
addPage(<span class="keyword">new</span> CodeStylePage);
addPage(<span class="keyword">new</span> OutputFilesPage);
addPage(<span class="keyword">new</span> ConclusionPage);
setPixmap(<span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">::</span>BannerPixmap<span class="operator">,</span> <span class="type"><a href="qpixmap.html">QPixmap</a></span>(<span class="string">":/images/banner.png"</span>));
setPixmap(<span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">::</span>BackgroundPixmap<span class="operator">,</span> <span class="type"><a href="qpixmap.html">QPixmap</a></span>(<span class="string">":/images/background.png"</span>));
setWindowTitle(tr(<span class="string">"Class Wizard"</span>));
}</pre>
<p>We instantiate the five pages and insert them into the wizard using <a href="qwizard.html#addPage">QWizard::addPage</a>(). The order in which they are inserted is also the order in which they will be shown later on.</p>
<p>We call <a href="qwizard.html#setPixmap">QWizard::setPixmap</a>() to set the banner and the background pixmaps for all pages. The banner is used as a background for the page header when the wizard's style is <a href="qwizard.html#WizardStyle-enum">ModernStyle</a>; the background is used as the dialog's background in <a href="qwizard.html#WizardStyle-enum">MacStyle</a>. (See <a href="qwizard.html#elements-of-a-wizard-page">Elements of a Wizard Page</a> for more information.)</p>
<pre class="cpp"> <span class="type">void</span> ClassWizard<span class="operator">::</span>accept()
{
<span class="type"><a href="qbytearray.html">QByteArray</a></span> className <span class="operator">=</span> field(<span class="string">"className"</span>)<span class="operator">.</span>toByteArray();
<span class="type"><a href="qbytearray.html">QByteArray</a></span> baseClass <span class="operator">=</span> field(<span class="string">"baseClass"</span>)<span class="operator">.</span>toByteArray();
<span class="type"><a href="qbytearray.html">QByteArray</a></span> macroName <span class="operator">=</span> field(<span class="string">"macroName"</span>)<span class="operator">.</span>toByteArray();
<span class="type"><a href="qbytearray.html">QByteArray</a></span> baseInclude <span class="operator">=</span> field(<span class="string">"baseInclude"</span>)<span class="operator">.</span>toByteArray();
<span class="type"><a href="qstring.html">QString</a></span> outputDir <span class="operator">=</span> field(<span class="string">"outputDir"</span>)<span class="operator">.</span>toString();
<span class="type"><a href="qstring.html">QString</a></span> header <span class="operator">=</span> field(<span class="string">"header"</span>)<span class="operator">.</span>toString();
<span class="type"><a href="qstring.html">QString</a></span> implementation <span class="operator">=</span> field(<span class="string">"implementation"</span>)<span class="operator">.</span>toString();
...
<span class="type"><a href="qdialog.html">QDialog</a></span><span class="operator">::</span>accept();
}</pre>
<p>If the user clicks <b>Finish</b>, we extract the information from the various pages using <a href="qwizard.html#field">QWizard::field</a>() and generate the files. The code is long and tedious (and has barely anything to do with noble art of designing wizards), so most of it is skipped here. See the actual example in the Qt distribution for the details if you're curious.</p>
<a name="the-intropage-class"></a>
<h2>The IntroPage Class</h2>
<p>The pages are defined in <tt>classwizard.h</tt> and implemented in <tt>classwizard.cpp</tt>, together with <tt>ClassWizard</tt>. We will start with the easiest page:</p>
<pre class="cpp"> <span class="keyword">class</span> IntroPage : <span class="keyword">public</span> <span class="type"><a href="qwizardpage.html">QWizardPage</a></span>
{
Q_OBJECT
<span class="keyword">public</span>:
IntroPage(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
<span class="keyword">private</span>:
<span class="type"><a href="qlabel.html">QLabel</a></span> <span class="operator">*</span>label;
};
IntroPage<span class="operator">::</span>IntroPage(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
: <span class="type"><a href="qwizardpage.html">QWizardPage</a></span>(parent)
{
setTitle(tr(<span class="string">"Introduction"</span>));
setPixmap(<span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">::</span>WatermarkPixmap<span class="operator">,</span> <span class="type"><a href="qpixmap.html">QPixmap</a></span>(<span class="string">":/images/watermark1.png"</span>));
label <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlabel.html">QLabel</a></span>(tr(<span class="string">"This wizard will generate a skeleton C++ class "</span>
<span class="string">"definition, including a few functions. You simply "</span>
<span class="string">"need to specify the class name and set a few "</span>
<span class="string">"options to produce a header file and an "</span>
<span class="string">"implementation file for your new C++ class."</span>));
label<span class="operator">-</span><span class="operator">></span>setWordWrap(<span class="keyword">true</span>);
<span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span> <span class="operator">*</span>layout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span>;
layout<span class="operator">-</span><span class="operator">></span>addWidget(label);
setLayout(layout);
}</pre>
<p>A page inherits from <a href="qwizardpage.html">QWizardPage</a>. We set a <a href="qwizardpage.html#title-prop">title</a> and a <a href="qwizard.html#WizardPixmap-enum">watermark pixmap</a>. By not setting any <a href="qwizardpage.html#subTitle-prop">subTitle</a>, we ensure that no header is displayed for this page. (On Windows, it is customary for wizards to display a watermark pixmap on the first and last pages, and to have a header on the other pages.)</p>
<p>Then we create a <a href="qlabel.html">QLabel</a> and add it to a layout.</p>
<a name="the-classinfopage-class"></a>
<h2>The ClassInfoPage Class</h2>
<p>The second page is defined and implemented as follows:</p>
<pre class="cpp"> <span class="keyword">class</span> ClassInfoPage : <span class="keyword">public</span> <span class="type"><a href="qwizardpage.html">QWizardPage</a></span>
{
Q_OBJECT
<span class="keyword">public</span>:
ClassInfoPage(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
<span class="keyword">private</span>:
<span class="type"><a href="qlabel.html">QLabel</a></span> <span class="operator">*</span>classNameLabel;
<span class="type"><a href="qlabel.html">QLabel</a></span> <span class="operator">*</span>baseClassLabel;
<span class="type"><a href="qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>classNameLineEdit;
<span class="type"><a href="qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>baseClassLineEdit;
<span class="type"><a href="qcheckbox.html">QCheckBox</a></span> <span class="operator">*</span>qobjectMacroCheckBox;
<span class="type"><a href="qgroupbox.html">QGroupBox</a></span> <span class="operator">*</span>groupBox;
<span class="type"><a href="qradiobutton.html">QRadioButton</a></span> <span class="operator">*</span>qobjectCtorRadioButton;
<span class="type"><a href="qradiobutton.html">QRadioButton</a></span> <span class="operator">*</span>qwidgetCtorRadioButton;
<span class="type"><a href="qradiobutton.html">QRadioButton</a></span> <span class="operator">*</span>defaultCtorRadioButton;
<span class="type"><a href="qcheckbox.html">QCheckBox</a></span> <span class="operator">*</span>copyCtorCheckBox;
};
ClassInfoPage<span class="operator">::</span>ClassInfoPage(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
: <span class="type"><a href="qwizardpage.html">QWizardPage</a></span>(parent)
{
setTitle(tr(<span class="string">"Class Information"</span>));
setSubTitle(tr(<span class="string">"Specify basic information about the class for which you "</span>
<span class="string">"want to generate skeleton source code files."</span>));
setPixmap(<span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">::</span>LogoPixmap<span class="operator">,</span> <span class="type"><a href="qpixmap.html">QPixmap</a></span>(<span class="string">":/images/logo1.png"</span>));
classNameLabel <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlabel.html">QLabel</a></span>(tr(<span class="string">"&Class name:"</span>));
classNameLineEdit <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>;
classNameLabel<span class="operator">-</span><span class="operator">></span>setBuddy(classNameLineEdit);
baseClassLabel <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlabel.html">QLabel</a></span>(tr(<span class="string">"B&ase class:"</span>));
baseClassLineEdit <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>;
baseClassLabel<span class="operator">-</span><span class="operator">></span>setBuddy(baseClassLineEdit);
qobjectMacroCheckBox <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qcheckbox.html">QCheckBox</a></span>(tr(<span class="string">"Generate Q_OBJECT &macro"</span>));
groupBox <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qgroupbox.html">QGroupBox</a></span>(tr(<span class="string">"C&onstructor"</span>));
...
registerField(<span class="string">"className*"</span><span class="operator">,</span> classNameLineEdit);
registerField(<span class="string">"baseClass"</span><span class="operator">,</span> baseClassLineEdit);
registerField(<span class="string">"qobjectMacro"</span><span class="operator">,</span> qobjectMacroCheckBox);
registerField(<span class="string">"qobjectCtor"</span><span class="operator">,</span> qobjectCtorRadioButton);
registerField(<span class="string">"qwidgetCtor"</span><span class="operator">,</span> qwidgetCtorRadioButton);
registerField(<span class="string">"defaultCtor"</span><span class="operator">,</span> defaultCtorRadioButton);
registerField(<span class="string">"copyCtor"</span><span class="operator">,</span> copyCtorCheckBox);
<span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span> <span class="operator">*</span>groupBoxLayout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span>;
...
}</pre>
<p>First, we set the page's <a href="qwizardpage.html#title-prop">title</a>, <a href="qwizardpage.html#subTitle-prop">subTitle</a>, and <a href="qwizard.html#WizardPixmap-enum">logo pixmap</a>. The logo pixmap is displayed in the page's header in <a href="qwizard.html#WizardStyle-enum">ClassicStyle</a> and <a href="qwizard.html#WizardStyle-enum">ModernStyle</a>.</p>
<p>Then we create the child widgets, create <a href="qwizard.html#registering-and-using-fields">wizard fields</a> associated with them, and put them into layouts. The <tt>className</tt> field is created with an asterisk (<tt>*</tt>) next to its name. This makes it a <a href="qwizard.html#mandatory-fields">mandatory field</a>, that is, a field that must be filled before the user can press the <b>Next</b> button (<b>Continue</b> on Mac OS X). The fields' values can be accessed from any other page using <a href="qwizardpage.html#field">QWizardPage::field</a>(), or from the wizard code using <a href="qwizard.html#field">QWizard::field</a>().</p>
<a name="the-codestylepage-class"></a>
<h2>The CodeStylePage Class</h2>
<p>The third page is defined and implemented as follows:</p>
<pre class="cpp"> <span class="keyword">class</span> CodeStylePage : <span class="keyword">public</span> <span class="type"><a href="qwizardpage.html">QWizardPage</a></span>
{
Q_OBJECT
<span class="keyword">public</span>:
CodeStylePage(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
<span class="keyword">protected</span>:
<span class="type">void</span> initializePage();
<span class="keyword">private</span>:
<span class="type"><a href="qcheckbox.html">QCheckBox</a></span> <span class="operator">*</span>commentCheckBox;
<span class="type"><a href="qcheckbox.html">QCheckBox</a></span> <span class="operator">*</span>protectCheckBox;
<span class="type"><a href="qcheckbox.html">QCheckBox</a></span> <span class="operator">*</span>includeBaseCheckBox;
<span class="type"><a href="qlabel.html">QLabel</a></span> <span class="operator">*</span>macroNameLabel;
<span class="type"><a href="qlabel.html">QLabel</a></span> <span class="operator">*</span>baseIncludeLabel;
<span class="type"><a href="qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>macroNameLineEdit;
<span class="type"><a href="qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>baseIncludeLineEdit;
};
CodeStylePage<span class="operator">::</span>CodeStylePage(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
: <span class="type"><a href="qwizardpage.html">QWizardPage</a></span>(parent)
{
setTitle(tr(<span class="string">"Code Style Options"</span>));
setSubTitle(tr(<span class="string">"Choose the formatting of the generated code."</span>));
setPixmap(<span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">::</span>LogoPixmap<span class="operator">,</span> <span class="type"><a href="qpixmap.html">QPixmap</a></span>(<span class="string">":/images/logo2.png"</span>));
commentCheckBox <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qcheckbox.html">QCheckBox</a></span>(tr(<span class="string">"&Start generated files with a "</span>
...
setLayout(layout);
}
<span class="type">void</span> CodeStylePage<span class="operator">::</span>initializePage()
{
<span class="type"><a href="qstring.html">QString</a></span> className <span class="operator">=</span> field(<span class="string">"className"</span>)<span class="operator">.</span>toString();
macroNameLineEdit<span class="operator">-</span><span class="operator">></span>setText(className<span class="operator">.</span>toUpper() <span class="operator">+</span> <span class="string">"_H"</span>);
<span class="type"><a href="qstring.html">QString</a></span> baseClass <span class="operator">=</span> field(<span class="string">"baseClass"</span>)<span class="operator">.</span>toString();
includeBaseCheckBox<span class="operator">-</span><span class="operator">></span>setChecked(<span class="operator">!</span>baseClass<span class="operator">.</span>isEmpty());
includeBaseCheckBox<span class="operator">-</span><span class="operator">></span>setEnabled(<span class="operator">!</span>baseClass<span class="operator">.</span>isEmpty());
baseIncludeLabel<span class="operator">-</span><span class="operator">></span>setEnabled(<span class="operator">!</span>baseClass<span class="operator">.</span>isEmpty());
baseIncludeLineEdit<span class="operator">-</span><span class="operator">></span>setEnabled(<span class="operator">!</span>baseClass<span class="operator">.</span>isEmpty());
<span class="keyword">if</span> (baseClass<span class="operator">.</span>isEmpty()) {
baseIncludeLineEdit<span class="operator">-</span><span class="operator">></span>clear();
} <span class="keyword">else</span> <span class="keyword">if</span> (<span class="type"><a href="qregexp.html">QRegExp</a></span>(<span class="string">"Q[A-Z].*"</span>)<span class="operator">.</span>exactMatch(baseClass)) {
baseIncludeLineEdit<span class="operator">-</span><span class="operator">></span>setText(<span class="string">"<"</span> <span class="operator">+</span> baseClass <span class="operator">+</span> <span class="string">">"</span>);
} <span class="keyword">else</span> {
baseIncludeLineEdit<span class="operator">-</span><span class="operator">></span>setText(<span class="string">"\""</span> <span class="operator">+</span> baseClass<span class="operator">.</span>toLower() <span class="operator">+</span> <span class="string">".h\""</span>);
}
}</pre>
<p>The code in the constructor is very similar to what we did for <tt>ClassInfoPage</tt>, so we skipped most of it.</p>
<p>The <tt>initializePage()</tt> function is what makes this class interesting. It is reimplemented from <a href="qwizardpage.html">QWizardPage</a> and is used to initialize some of the page's fields with values from the previous page (namely, <tt>className</tt> and <tt>baseClass</tt>). For example, if the class name on page 2 is <tt>SuperDuperWidget</tt>, the default macro name on page 3 is <tt>SUPERDUPERWIDGET_H</tt>.</p>
<p>The <tt>OutputFilesPage</tt> and <tt>ConclusionPage</tt> classes are very similar to <tt>CodeStylePage</tt>, so we won't review them here.</p>
</div>
<p><b>See also </b><a href="qwizard.html">QWizard</a>, <a href="dialogs-licensewizard.html">License Wizard Example</a>, and <a href="dialogs-trivialwizard.html">Trivial Wizard Example</a>.</p>
<!-- @@@dialogs/classwizard -->
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|