<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QWizard Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QWizard Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QWizard class provides a framework for wizards. <a href="#details">More...</a></p> <p>Inherits <a href="qdialog.html">QDialog</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qwizard.html#WizardButton-enum">WizardButton</a></b> { BackButton, NextButton, CommitButton, FinishButton, ..., Stretch }</li><li><div class="fn" />enum <b><a href="qwizard.html#WizardOption-enum">WizardOption</a></b> { IndependentPages, IgnoreSubTitles, ExtendedWatermarkPixmap, NoDefaultButton, ..., HaveCustomButton3 }</li><li><div class="fn" />class <b><a href="qwizard-wizardoptions.html">WizardOptions</a></b></li><li><div class="fn" />enum <b><a href="qwizard.html#WizardPixmap-enum">WizardPixmap</a></b> { WatermarkPixmap, LogoPixmap, BannerPixmap, BackgroundPixmap }</li><li><div class="fn" />enum <b><a href="qwizard.html#WizardStyle-enum">WizardStyle</a></b> { ClassicStyle, ModernStyle, MacStyle, AeroStyle }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qwizard.html#QWizard">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None, Qt.WindowFlags <i>flags</i> = 0)</li><li><div class="fn" />int <b><a href="qwizard.html#addPage">addPage</a></b> (<i>self</i>, QWizardPage <i>page</i>)</li><li><div class="fn" /><b><a href="qwizard.html#back">back</a></b> (<i>self</i>)</li><li><div class="fn" />QAbstractButton <b><a href="qwizard.html#button">button</a></b> (<i>self</i>, WizardButton <i>which</i>)</li><li><div class="fn" />QString <b><a href="qwizard.html#buttonText">buttonText</a></b> (<i>self</i>, WizardButton <i>which</i>)</li><li><div class="fn" /><b><a href="qwizard.html#cleanupPage">cleanupPage</a></b> (<i>self</i>, int <i>id</i>)</li><li><div class="fn" />int <b><a href="qwizard.html#currentId">currentId</a></b> (<i>self</i>)</li><li><div class="fn" />QWizardPage <b><a href="qwizard.html#currentPage">currentPage</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwizard.html#done">done</a></b> (<i>self</i>, int <i>result</i>)</li><li><div class="fn" />bool <b><a href="qwizard.html#event">event</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" />QVariant <b><a href="qwizard.html#field">field</a></b> (<i>self</i>, QString <i>name</i>)</li><li><div class="fn" />bool <b><a href="qwizard.html#hasVisitedPage">hasVisitedPage</a></b> (<i>self</i>, int <i>id</i>)</li><li><div class="fn" /><b><a href="qwizard.html#initializePage">initializePage</a></b> (<i>self</i>, int <i>id</i>)</li><li><div class="fn" /><b><a href="qwizard.html#next">next</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qwizard.html#nextId">nextId</a></b> (<i>self</i>)</li><li><div class="fn" />WizardOptions <b><a href="qwizard.html#options">options</a></b> (<i>self</i>)</li><li><div class="fn" />QWizardPage <b><a href="qwizard.html#page">page</a></b> (<i>self</i>, int <i>id</i>)</li><li><div class="fn" />list-of-int <b><a href="qwizard.html#pageIds">pageIds</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwizard.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent <i>event</i>)</li><li><div class="fn" />QPixmap <b><a href="qwizard.html#pixmap">pixmap</a></b> (<i>self</i>, WizardPixmap <i>which</i>)</li><li><div class="fn" /><b><a href="qwizard.html#removePage">removePage</a></b> (<i>self</i>, int <i>id</i>)</li><li><div class="fn" /><b><a href="qwizard.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qwizard.html#restart">restart</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setButton">setButton</a></b> (<i>self</i>, WizardButton <i>which</i>, QAbstractButton <i>button</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setButtonLayout">setButtonLayout</a></b> (<i>self</i>, list-of-QWizard.WizardButton <i>layout</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setButtonText">setButtonText</a></b> (<i>self</i>, WizardButton <i>which</i>, QString <i>text</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setDefaultProperty">setDefaultProperty</a></b> (<i>self</i>, str <i>className</i>, str <i>property</i>, str <i>changedSignal</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setField">setField</a></b> (<i>self</i>, QString <i>name</i>, QVariant <i>value</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setOption">setOption</a></b> (<i>self</i>, WizardOption <i>option</i>, bool <i>on</i> = True)</li><li><div class="fn" /><b><a href="qwizard.html#setOptions">setOptions</a></b> (<i>self</i>, WizardOptions <i>options</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setPage">setPage</a></b> (<i>self</i>, int <i>id</i>, QWizardPage <i>page</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setPixmap">setPixmap</a></b> (<i>self</i>, WizardPixmap <i>which</i>, QPixmap <i>pixmap</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setSideWidget">setSideWidget</a></b> (<i>self</i>, QWidget <i>widget</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setStartId">setStartId</a></b> (<i>self</i>, int <i>id</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setSubTitleFormat">setSubTitleFormat</a></b> (<i>self</i>, Qt.TextFormat <i>format</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setTitleFormat">setTitleFormat</a></b> (<i>self</i>, Qt.TextFormat <i>format</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setVisible">setVisible</a></b> (<i>self</i>, bool <i>visible</i>)</li><li><div class="fn" /><b><a href="qwizard.html#setWizardStyle">setWizardStyle</a></b> (<i>self</i>, WizardStyle <i>style</i>)</li><li><div class="fn" />QWidget <b><a href="qwizard.html#sideWidget">sideWidget</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qwizard.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qwizard.html#startId">startId</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextFormat <b><a href="qwizard.html#subTitleFormat">subTitleFormat</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwizard.html#testOption">testOption</a></b> (<i>self</i>, WizardOption <i>option</i>)</li><li><div class="fn" />Qt.TextFormat <b><a href="qwizard.html#titleFormat">titleFormat</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwizard.html#validateCurrentPage">validateCurrentPage</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-int <b><a href="qwizard.html#visitedPages">visitedPages</a></b> (<i>self</i>)</li><li><div class="fn" />WizardStyle <b><a href="qwizard.html#wizardStyle">wizardStyle</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qwizard.html#currentIdChanged">currentIdChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="qwizard.html#customButtonClicked">customButtonClicked</a></b> (int)</li><li><div class="fn" />void <b><a href="qwizard.html#helpRequested">helpRequested</a></b> ()</li><li><div class="fn" />void <b><a href="qwizard.html#pageAdded">pageAdded</a></b> (int)</li><li><div class="fn" />void <b><a href="qwizard.html#pageRemoved">pageRemoved</a></b> (int)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QWizard class provides a framework for wizards.</p> <p>A wizard (also called an assistant on Mac OS X) is a special type of input dialog that consists of a sequence of pages. A wizard's purpose is to guide the user through a process step by step. Wizards are useful for complex or infrequent tasks that users may find difficult to learn.</p> <p>QWizard inherits <a href="qdialog.html">QDialog</a> and represents a wizard. Each page is a <a href="qwizardpage.html">QWizardPage</a> (a <a href="qwidget.html">QWidget</a> subclass). To create your own wizards, you can use these classes directly, or you can subclass them for more control.</p> <p>Topics:</p> <a id="a-trivial-example" name="a-trivial-example" /> <h3>A Trivial Example</h3> <p>The following example illustrates how to create wizard pages and add them to a wizard. For more advanced examples, see <a href="dialogs-classwizard.html">Class Wizard</a> and <a href="dialogs-licensewizard.html">License Wizard</a>.</p> <pre class="cpp"> <span class="type"><a href="qwizardpage.html">QWizardPage</a></span> <span class="operator">*</span>createIntroPage() { <span class="type"><a href="qwizardpage.html">QWizardPage</a></span> <span class="operator">*</span>page <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qwizardpage.html">QWizardPage</a></span>; page<span class="operator">-</span><span class="operator">></span>setTitle(<span class="string">"Introduction"</span>); <span class="type"><a href="qlabel.html">QLabel</a></span> <span class="operator">*</span>label <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlabel.html">QLabel</a></span>(<span class="string">"This wizard will help you register your copy "</span> <span class="string">"of Super Product Two."</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); page<span class="operator">-</span><span class="operator">></span>setLayout(layout); <span class="keyword">return</span> page; } <span class="type"><a href="qwizardpage.html">QWizardPage</a></span> <span class="operator">*</span>createRegistrationPage() { ... } <span class="type"><a href="qwizardpage.html">QWizardPage</a></span> <span class="operator">*</span>createConclusionPage() { ... } <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>) { <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv); <span class="type"><a href="qstring.html">QString</a></span> translatorFileName <span class="operator">=</span> QLatin1String(<span class="string">"qt_"</span>); translatorFileName <span class="operator">+</span><span class="operator">=</span> <span class="type"><a href="qlocale.html">QLocale</a></span><span class="operator">.</span>system()<span class="operator">.</span>name(); <span class="type"><a href="qtranslator.html">QTranslator</a></span> <span class="operator">*</span>translator <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qtranslator.html">QTranslator</a></span>(<span class="operator">&</span>app); <span class="keyword">if</span> (translator<span class="operator">-</span><span class="operator">></span>load(translatorFileName<span class="operator">,</span> <span class="type"><a href="qlibraryinfo.html">QLibraryInfo</a></span><span class="operator">.</span>location(<span class="type"><a href="qlibraryinfo.html">QLibraryInfo</a></span><span class="operator">.</span>TranslationsPath))) app<span class="operator">.</span>installTranslator(translator); <span class="type">QWizard</span> wizard; wizard<span class="operator">.</span>addPage(createIntroPage()); wizard<span class="operator">.</span>addPage(createRegistrationPage()); wizard<span class="operator">.</span>addPage(createConclusionPage()); wizard<span class="operator">.</span>setWindowTitle(<span class="string">"Trivial Wizard"</span>); <span class="preprocessor">#ifdef Q_OS_SYMBIAN</span> wizard<span class="operator">.</span>showMaximized(); <span class="preprocessor">#else</span> wizard<span class="operator">.</span>show(); <span class="preprocessor">#endif</span> <span class="keyword">return</span> app<span class="operator">.</span>exec(); } </pre> <a id="wizard-look-and-feel" name="wizard-look-and-feel" /> <h3>Wizard Look and Feel</h3> <p>QWizard supports four wizard looks:</p> <ul> <li><a href="qwizard.html#WizardStyle-enum">ClassicStyle</a></li> <li><a href="qwizard.html#WizardStyle-enum">ModernStyle</a></li> <li><a href="qwizard.html#WizardStyle-enum">MacStyle</a></li> <li><a href="qwizard.html#WizardStyle-enum">AeroStyle</a></li> </ul> <p>You can explicitly set the look to use using <a href="qwizard.html#wizardStyle-prop">setWizardStyle</a>() (e.g., if you want the same look on all platforms).</p> <table class="generic"> <thead> <tr class="qt-style"> <th><a href="qwizard.html#WizardStyle-enum">ClassicStyle</a></th> <th><a href="qwizard.html#WizardStyle-enum">ModernStyle</a></th> <th><a href="qwizard.html#WizardStyle-enum">MacStyle</a></th> <th><a href="qwizard.html#WizardStyle-enum">AeroStyle</a></th> </tr> </thead> <tr class="odd" valign="top"> <td><img alt="" src="images/qtwizard-classic1.png" /></td> <td><img alt="" src="images/qtwizard-modern1.png" /></td> <td><img alt="" src="images/qtwizard-mac1.png" /></td> <td><img alt="" src="images/qtwizard-aero1.png" /></td> </tr> <tr class="even" valign="top"> <td><img alt="" src="images/qtwizard-classic2.png" /></td> <td><img alt="" src="images/qtwizard-modern2.png" /></td> <td><img alt="" src="images/qtwizard-mac2.png" /></td> <td><img alt="" src="images/qtwizard-aero2.png" /></td> </tr> </table> <p>Note: <a href="qwizard.html#WizardStyle-enum">AeroStyle</a> has effect only on a Windows Vista system with alpha compositing enabled. <a href="qwizard.html#WizardStyle-enum">ModernStyle</a> is used as a fallback when this condition is not met.</p> <p>In addition to the wizard style, there are several options that control the look and feel of the wizard. These can be set using <a href="qwizard.html#setOption">setOption</a>() or <a href="qwizard.html#options-prop">setOptions</a>(). For example, <a href="qwizard.html#WizardOption-enum">HaveHelpButton</a> makes QWizard show a <b>Help</b> button along with the other wizard buttons.</p> <p>You can even change the order of the wizard buttons to any arbitrary order using <a href="qwizard.html#setButtonLayout">setButtonLayout</a>(), and you can add up to three custom buttons (e.g., a <b>Print</b> button) to the button row. This is achieved by calling <a href="qwizard.html#setButton">setButton</a>() or <a href="qwizard.html#setButtonText">setButtonText</a>() with <a href="qwizard.html#WizardButton-enum">CustomButton1</a>, <a href="qwizard.html#WizardButton-enum">CustomButton2</a>, or <a href="qwizard.html#WizardButton-enum">CustomButton3</a> to set up the button, and by enabling the <a href="qwizard.html#WizardOption-enum">HaveCustomButton1</a>, <a href="qwizard.html#WizardOption-enum">HaveCustomButton2</a>, or <a href="qwizard.html#WizardOption-enum">HaveCustomButton3</a> options. Whenever the user clicks a custom button, <a href="qwizard.html#customButtonClicked">customButtonClicked</a>() is emitted. For example:</p> <pre class="cpp"> wizard()<span class="operator">-</span><span class="operator">></span>setButtonText(<span class="type">QWizard</span><span class="operator">.</span>CustomButton1<span class="operator">,</span> tr(<span class="string">"&Print"</span>)); wizard()<span class="operator">-</span><span class="operator">></span>setOption(<span class="type">QWizard</span><span class="operator">.</span>HaveCustomButton1<span class="operator">,</span> <span class="keyword">true</span>); connect(wizard()<span class="operator">,</span> SIGNAL(customButtonClicked(<span class="type">int</span>))<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(printButtonClicked())); </pre> <a id="elements-of-a-wizard-page" name="elements-of-a-wizard-page" /> <h3>Elements of a Wizard Page</h3> <p>Wizards consist of a sequence of <a href="qwizardpage.html">QWizardPage</a>s. At any time, only one page is shown. A page has the following attributes:</p> <ul> <li>A <a href="qwizardpage.html#title-prop">title</a>.</li> <li>A <a href="qwizardpage.html#subTitle-prop">subTitle</a>.</li> <li>A set of pixmaps, which may or may not be honored, depending on the wizard's style: <ul> <li><a href="qwizard.html#WizardPixmap-enum">WatermarkPixmap</a> (used by <a href="qwizard.html#WizardStyle-enum">ClassicStyle</a> and <a href="qwizard.html#WizardStyle-enum">ModernStyle</a>)</li> <li><a href="qwizard.html#WizardPixmap-enum">BannerPixmap</a> (used by <a href="qwizard.html#WizardStyle-enum">ModernStyle</a>)</li> <li><a href="qwizard.html#WizardPixmap-enum">LogoPixmap</a> (used by <a href="qwizard.html#WizardStyle-enum">ClassicStyle</a> and <a href="qwizard.html#WizardStyle-enum">ModernStyle</a>)</li> <li><a href="qwizard.html#WizardPixmap-enum">BackgroundPixmap</a> (used by <a href="qwizard.html#WizardStyle-enum">MacStyle</a>)</li> </ul> </li> </ul> <p>The diagram belows shows how QWizard renders these attributes, assuming they are all present and <a href="qwizard.html#WizardStyle-enum">ModernStyle</a> is used:</p> <p class="centerAlign"><img alt="" src="images/qtwizard-nonmacpage.png" /></p> <p>When a <a href="qwizardpage.html#subTitle-prop">subTitle</a> is set, QWizard displays it in a header, in which case it also uses the <a href="qwizard.html#WizardPixmap-enum">BannerPixmap</a> and the <a href="qwizard.html#WizardPixmap-enum">LogoPixmap</a> to decorate the header. The <a href="qwizard.html#WizardPixmap-enum">WatermarkPixmap</a> is displayed on the left side, below the header. At the bottom, there is a row of buttons allowing the user to navigate through the pages.</p> <p>The page itself (the <a href="qwizardpage.html">QWizardPage</a> widget) occupies the area between the header, the watermark, and the button row. Typically, the page is a <a href="qwizardpage.html">QWizardPage</a> on which a <a href="qgridlayout.html">QGridLayout</a> is installed, with standard child widgets (<a href="qlabel.html">QLabel</a>s, <a href="qlineedit.html">QLineEdit</a>s, etc.).</p> <p>If the wizard's style is <a href="qwizard.html#WizardStyle-enum">MacStyle</a>, the page looks radically different:</p> <p class="centerAlign"><img alt="" src="images/qtwizard-macpage.png" /></p> <p>The watermark, banner, and logo pixmaps are ignored by the <a href="qwizard.html#WizardStyle-enum">MacStyle</a>. If the <a href="qwizard.html#WizardPixmap-enum">BackgroundPixmap</a> is set, it is used as the background for the wizard; otherwise, a default "assistant" image is used.</p> <p>The title and subtitle are set by calling <a href="qwizardpage.html#title-prop">QWizardPage.setTitle</a>() and <a href="qwizardpage.html#subTitle-prop">QWizardPage.setSubTitle</a>() on the individual pages. They may be plain text or HTML (see <a href="qwizard.html#titleFormat-prop">titleFormat</a> and <a href="qwizard.html#subTitleFormat-prop">subTitleFormat</a>). The pixmaps can be set globally for the entire wizard using <a href="qwizard.html#setPixmap">setPixmap</a>(), or on a per-page basis using <a href="qwizardpage.html#setPixmap">QWizardPage.setPixmap</a>().</p> <a id="field-mechanism" name="field-mechanism" /><a id="registering-and-using-fields" name="registering-and-using-fields" /> <h3>Registering and Using Fields</h3> <p>In many wizards, the contents of a page may affect the default values of the fields of a later page. To make it easy to communicate between pages, QWizard supports a "field" mechanism that allows you to register a field (e.g., a <a href="qlineedit.html">QLineEdit</a>) on a page and to access its value from any page. It is also possible to specify mandatory fields (i.e., fields that must be filled before the user can advance to the next page).</p> <p>To register a field, call <a href="qwizardpage.html#registerField">QWizardPage.registerField</a>() field. For example:</p> <pre class="cpp"> 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) { ... 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>)); 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); ... } </pre> <p>The above code registers three fields, <tt>className</tt>, <tt>baseClass</tt>, and <tt>qobjectMacro</tt>, which are associated with three child widgets. The asterisk (<tt>*</tt>) next to <tt>className</tt> denotes a mandatory field.</p> <a id="initialize-page" name="initialize-page" /> <p>The fields of any page are accessible from any other page. For example:</p> <pre class="cpp"> <span class="type">void</span> OutputFilesPage<span class="operator">.</span><a href="qwizard.html#initializePage">initializePage</a>() { <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(); headerLineEdit<span class="operator">-</span><span class="operator">></span>setText(className<span class="operator">.</span>toLower() <span class="operator">+</span> <span class="string">".h"</span>); implementationLineEdit<span class="operator">-</span><span class="operator">></span>setText(className<span class="operator">.</span>toLower() <span class="operator">+</span> <span class="string">".cpp"</span>); outputDirLineEdit<span class="operator">-</span><span class="operator">></span>setText(<span class="type"><a href="qdir.html">QDir</a></span><span class="operator">.</span>convertSeparators(<span class="type"><a href="qdir.html">QDir</a></span><span class="operator">.</span>tempPath())); } </pre> <p>Here, we call <a href="qwizardpage.html#field">QWizardPage.field</a>() to access the contents of the <tt>className</tt> field (which was defined in the <tt>ClassInfoPage</tt>) and use it to initialize the <tt>OuputFilePage</tt>. The field's contents is returned as a <a href="qvariant.html">QVariant</a>.</p> <p>When we create a field using <a href="qwizardpage.html#registerField">QWizardPage.registerField</a>(), we pass a unique field name and a widget. We can also provide a Qt property name and a "changed" signal (a signal that is emitted when the property changes) as third and fourth arguments; however, this is not necessary for the most common Qt widgets, such as <a href="qlineedit.html">QLineEdit</a>, <a href="qcheckbox.html">QCheckBox</a>, and <a href="qcombobox.html">QComboBox</a>, because QWizard knows which properties to look for.</p> <a id="mandatory-fields" name="mandatory-fields" /> <p>If an asterisk (<tt>*</tt>) is appended to the name when the property is registered, the field is a <i>mandatory field</i>. When a page has mandatory fields, the <b>Next</b> and/or <b>Finish</b> buttons are enabled only when all mandatory fields are filled.</p> <p>To consider a field "filled", QWizard simply checks that the field's current value doesn't equal the original value (the value it had when <a href="qwizard.html#initializePage">initializePage</a>() was called). For <a href="qlineedit.html">QLineEdit</a> and <a href="qabstractspinbox.html">QAbstractSpinBox</a> subclasses, QWizard also checks that <a href="qlineedit.html#acceptableInput-prop">hasAcceptableInput()</a> returns true, to honor any validator or mask.</p> <p>QWizard's mandatory field mechanism is provided for convenience. A more powerful (but also more cumbersome) alternative is to reimplement <a href="qwizardpage.html#isComplete">QWizardPage.isComplete</a>() and to emit the <a href="qwizardpage.html#completeChanged">QWizardPage.completeChanged</a>() signal whenever the page becomes complete or incomplete.</p> <p>The enabled/disabled state of the <b>Next</b> and/or <b>Finish</b> buttons is one way to perform validation on the user input. Another way is to reimplement <a href="qwizard.html#validateCurrentPage">validateCurrentPage</a>() (or <a href="qwizardpage.html#validatePage">QWizardPage.validatePage</a>()) to perform some last-minute validation (and show an error message if the user has entered incomplete or invalid information). If the function returns true, the next page is shown (or the wizard finishes); otherwise, the current page stays up.</p> <a id="creating-linear-wizards" name="creating-linear-wizards" /> <h3>Creating Linear Wizards</h3> <p>Most wizards have a linear structure, with page 1 followed by page 2 and so on until the last page. The <a href="dialogs-classwizard.html">Class Wizard</a> example is such a wizard. With QWizard, linear wizards are created by instantiating the <a href="qwizardpage.html">QWizardPage</a>s and inserting them using <a href="qwizard.html#addPage">addPage</a>(). By default, the pages are shown in the order in which they were added. For example:</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">QWizard</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); ... } </pre> <p>When a page is about to be shown, QWizard calls <a href="qwizard.html#initializePage">initializePage</a>() (which in turn calls <a href="qwizardpage.html#initializePage">QWizardPage.initializePage</a>()) to fill the page with default values. By default, this function does nothing, but it can be reimplemented to initialize the page's contents based on other pages' fields (see the <a href="#initialize-page">example above</a>).</p> <p>If the user presses <b>Back</b>, <a href="qwizard.html#cleanupPage">cleanupPage</a>() is called (which in turn calls <a href="qwizardpage.html#cleanupPage">QWizardPage.cleanupPage</a>()). The default implementation resets the page's fields to their original values (the values they had before <a href="qwizard.html#initializePage">initializePage</a>() was called). If you want the <b>Back</b> button to be non-destructive and keep the values entered by the user, simply enable the <a href="qwizard.html#WizardOption-enum">IndependentPages</a> option.</p> <a id="creating-non-linear-wizards" name="creating-non-linear-wizards" /> <h3>Creating Non-Linear Wizards</h3> <p>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 illustrates this. It provides five wizard pages; depending on which options are selected, the user can reach different pages.</p> <p class="centerAlign"><img alt="" src="images/licensewizard-flow.png" /></p> <p>In complex wizards, pages are identified by IDs. These IDs are typically defined using an enum. For example:</p> <pre class="cpp"> <span class="keyword">class</span> LicenseWizard : <span class="keyword">public</span> <span class="type">QWizard</span> { ... <span class="keyword">enum</span> { Page_Intro<span class="operator">,</span> Page_Evaluate<span class="operator">,</span> Page_Register<span class="operator">,</span> Page_Details<span class="operator">,</span> Page_Conclusion }; ... }; </pre> <p>The pages are inserted using <a href="qwizard.html#setPage">setPage</a>(), which takes an ID and an instance of <a href="qwizardpage.html">QWizardPage</a> (or of a subclass):</p> <pre class="cpp"> LicenseWizard<span class="operator">.</span>LicenseWizard(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent) : <span class="type">QWizard</span>(parent) { setPage(Page_Intro<span class="operator">,</span> <span class="keyword">new</span> IntroPage); setPage(Page_Evaluate<span class="operator">,</span> <span class="keyword">new</span> EvaluatePage); setPage(Page_Register<span class="operator">,</span> <span class="keyword">new</span> RegisterPage); setPage(Page_Details<span class="operator">,</span> <span class="keyword">new</span> DetailsPage); setPage(Page_Conclusion<span class="operator">,</span> <span class="keyword">new</span> ConclusionPage); ... } </pre> <p>By default, the pages are shown in increasing ID order. To provide a dynamic order that depends on the options chosen by the user, we must reimplement <a href="qwizardpage.html#nextId">QWizardPage.nextId</a>(). For example:</p> <pre class="cpp"> <span class="type">int</span> IntroPage<span class="operator">.</span><a href="qwizard.html#nextId">nextId</a>() <span class="keyword">const</span> { <span class="keyword">if</span> (evaluateRadioButton<span class="operator">-</span><span class="operator">></span>isChecked()) { <span class="keyword">return</span> LicenseWizard<span class="operator">.</span>Page_Evaluate; } <span class="keyword">else</span> { <span class="keyword">return</span> LicenseWizard<span class="operator">.</span>Page_Register; } } <span class="type">int</span> EvaluatePage<span class="operator">.</span><a href="qwizard.html#nextId">nextId</a>() <span class="keyword">const</span> { <span class="keyword">return</span> LicenseWizard<span class="operator">.</span>Page_Conclusion; } <span class="type">int</span> RegisterPage<span class="operator">.</span><a href="qwizard.html#nextId">nextId</a>() <span class="keyword">const</span> { <span class="keyword">if</span> (upgradeKeyLineEdit<span class="operator">-</span><span class="operator">></span>text()<span class="operator">.</span>isEmpty()) { <span class="keyword">return</span> LicenseWizard<span class="operator">.</span>Page_Details; } <span class="keyword">else</span> { <span class="keyword">return</span> LicenseWizard<span class="operator">.</span>Page_Conclusion; } } <span class="type">int</span> DetailsPage<span class="operator">.</span><a href="qwizard.html#nextId">nextId</a>() <span class="keyword">const</span> { <span class="keyword">return</span> LicenseWizard<span class="operator">.</span>Page_Conclusion; } <span class="type">int</span> ConclusionPage<span class="operator">.</span><a href="qwizard.html#nextId">nextId</a>() <span class="keyword">const</span> { <span class="keyword">return</span> <span class="operator">-</span><span class="number">1</span>; } </pre> <p>It would also be possible to put all the logic in one place, in a <a href="qwizard.html#nextId">QWizard.nextId</a>() reimplementation. For example:</p> <pre class="cpp"> <span class="type">int</span> LicenseWizard<span class="operator">.</span><a href="qwizard.html#nextId">nextId</a>() <span class="keyword">const</span> { <span class="keyword">switch</span> (currentId()) { <span class="keyword">case</span> Page_Intro: <span class="keyword">if</span> (field(<span class="string">"intro.evaluate"</span>)<span class="operator">.</span>toBool()) { <span class="keyword">return</span> Page_Evaluate; } <span class="keyword">else</span> { <span class="keyword">return</span> Page_Register; } <span class="keyword">case</span> Page_Evaluate: <span class="keyword">return</span> Page_Conclusion; <span class="keyword">case</span> Page_Register: <span class="keyword">if</span> (field(<span class="string">"register.upgradeKey"</span>)<span class="operator">.</span>toString()<span class="operator">.</span>isEmpty()) { <span class="keyword">return</span> Page_Details; } <span class="keyword">else</span> { <span class="keyword">return</span> Page_Conclusion; } <span class="keyword">case</span> Page_Details: <span class="keyword">return</span> Page_Conclusion; <span class="keyword">case</span> Page_Conclusion: <span class="keyword">default</span>: <span class="keyword">return</span> <span class="operator">-</span><span class="number">1</span>; } } </pre> <p>To start at another page than the page with the lowest ID, call <a href="qwizard.html#startId-prop">setStartId</a>().</p> <p>To test whether a page has been visited or not, call <a href="qwizard.html#hasVisitedPage">hasVisitedPage</a>(). For example:</p> <pre class="cpp"> <span class="type">void</span> ConclusionPage<span class="operator">.</span><a href="qwizard.html#initializePage">initializePage</a>() { <span class="type"><a href="qstring.html">QString</a></span> licenseText; <span class="keyword">if</span> (wizard()<span class="operator">-</span><span class="operator">></span>hasVisitedPage(LicenseWizard<span class="operator">.</span>Page_Evaluate)) { licenseText <span class="operator">=</span> tr(<span class="string">"<u>Evaluation License Agreement:</u> "</span> <span class="string">"You can use this software for 30 days and make one "</span> <span class="string">"backup, but you are not allowed to distribute it."</span>); } <span class="keyword">else</span> <span class="keyword">if</span> (wizard()<span class="operator">-</span><span class="operator">></span>hasVisitedPage(LicenseWizard<span class="operator">.</span>Page_Details)) { licenseText <span class="operator">=</span> tr(<span class="string">"<u>First-Time License Agreement:</u> "</span> <span class="string">"You can use this software subject to the license "</span> <span class="string">"you will receive by email."</span>); } <span class="keyword">else</span> { licenseText <span class="operator">=</span> tr(<span class="string">"<u>Upgrade License Agreement:</u> "</span> <span class="string">"This software is licensed under the terms of your "</span> <span class="string">"current license."</span>); } bottomLabel<span class="operator">-</span><span class="operator">></span>setText(licenseText); } </pre><hr /><h2>Type Documentation</h2><h3 class="fn"><a name="WizardButton-enum" />QWizard.WizardButton</h3><p>This enum specifies the buttons in a wizard.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QWizard.BackButton</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">The <b>Back</b> button (<b>Go Back</b> on Mac OS X)</td> </tr> <tr> <td class="topAlign"><tt>QWizard.NextButton</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">The <b>Next</b> button (<b>Continue</b> on Mac OS X)</td> </tr> <tr> <td class="topAlign"><tt>QWizard.CommitButton</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">The <b>Commit</b> button</td> </tr> <tr> <td class="topAlign"><tt>QWizard.FinishButton</tt></td> <td class="topAlign"><tt>3</tt></td> <td class="topAlign">The <b>Finish</b> button (<b>Done</b> on Mac OS X)</td> </tr> <tr> <td class="topAlign"><tt>QWizard.CancelButton</tt></td> <td class="topAlign"><tt>4</tt></td> <td class="topAlign">The <b>Cancel</b> button (see also <a href="qwizard.html#WizardOption-enum">NoCancelButton</a>)</td> </tr> <tr> <td class="topAlign"><tt>QWizard.HelpButton</tt></td> <td class="topAlign"><tt>5</tt></td> <td class="topAlign">The <b>Help</b> button (see also <a href="qwizard.html#WizardOption-enum">HaveHelpButton</a>)</td> </tr> <tr> <td class="topAlign"><tt>QWizard.CustomButton1</tt></td> <td class="topAlign"><tt>6</tt></td> <td class="topAlign">The first user-defined button (see also <a href="qwizard.html#WizardOption-enum">HaveCustomButton1</a>)</td> </tr> <tr> <td class="topAlign"><tt>QWizard.CustomButton2</tt></td> <td class="topAlign"><tt>7</tt></td> <td class="topAlign">The second user-defined button (see also <a href="qwizard.html#WizardOption-enum">HaveCustomButton2</a>)</td> </tr> <tr> <td class="topAlign"><tt>QWizard.CustomButton3</tt></td> <td class="topAlign"><tt>8</tt></td> <td class="topAlign">The third user-defined button (see also <a href="qwizard.html#WizardOption-enum">HaveCustomButton3</a>)</td> </tr> </table> <p>The following value is only useful when calling <a href="qwizard.html#setButtonLayout">setButtonLayout</a>():</p> <table class="valuelist"> <tr class="even" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QWizard.Stretch</tt></td> <td class="topAlign"><tt>9</tt></td> <td class="topAlign">A horizontal stretch in the button layout</td> </tr> </table> <p><b>See also</b> <a href="qwizard.html#setButton">setButton</a>(), <a href="qwizard.html#setButtonText">setButtonText</a>(), <a href="qwizard.html#setButtonLayout">setButtonLayout</a>(), and <a href="qwizard.html#customButtonClicked">customButtonClicked</a>().</p> <h3 class="fn"><a name="WizardOption-enum" />QWizard.WizardOption</h3><p>This enum specifies various options that affect the look and feel of a wizard.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QWizard.IndependentPages</tt></td> <td class="topAlign"><tt>0x00000001</tt></td> <td class="topAlign">The pages are independent of each other (i.e., they don't derive values from each other).</td> </tr> <tr> <td class="topAlign"><tt>QWizard.IgnoreSubTitles</tt></td> <td class="topAlign"><tt>0x00000002</tt></td> <td class="topAlign">Don't show any subtitles, even if they are set.</td> </tr> <tr> <td class="topAlign"><tt>QWizard.ExtendedWatermarkPixmap</tt></td> <td class="topAlign"><tt>0x00000004</tt></td> <td class="topAlign">Extend any <a href="qwizard.html#WizardPixmap-enum">WatermarkPixmap</a> all the way down to the window's edge.</td> </tr> <tr> <td class="topAlign"><tt>QWizard.NoDefaultButton</tt></td> <td class="topAlign"><tt>0x00000008</tt></td> <td class="topAlign">Don't make the <b>Next</b> or <b>Finish</b> button the dialog's <a href="qpushbutton.html#default-prop">default button</a>.</td> </tr> <tr> <td class="topAlign"><tt>QWizard.NoBackButtonOnStartPage</tt></td> <td class="topAlign"><tt>0x00000010</tt></td> <td class="topAlign">Don't show the <b>Back</b> button on the start page.</td> </tr> <tr> <td class="topAlign"><tt>QWizard.NoBackButtonOnLastPage</tt></td> <td class="topAlign"><tt>0x00000020</tt></td> <td class="topAlign">Don't show the <b>Back</b> button on the last page.</td> </tr> <tr> <td class="topAlign"> <tt>QWizard.DisabledBackButtonOnLastPage</tt></td> <td class="topAlign"><tt>0x00000040</tt></td> <td class="topAlign">Disable the <b>Back</b> button on the last page.</td> </tr> <tr> <td class="topAlign"> <tt>QWizard.HaveNextButtonOnLastPage</tt></td> <td class="topAlign"><tt>0x00000080</tt></td> <td class="topAlign">Show the (disabled) <b>Next</b> button on the last page.</td> </tr> <tr> <td class="topAlign"> <tt>QWizard.HaveFinishButtonOnEarlyPages</tt></td> <td class="topAlign"><tt>0x00000100</tt></td> <td class="topAlign">Show the (disabled) <b>Finish</b> button on non-final pages.</td> </tr> <tr> <td class="topAlign"><tt>QWizard.NoCancelButton</tt></td> <td class="topAlign"><tt>0x00000200</tt></td> <td class="topAlign">Don't show the <b>Cancel</b> button.</td> </tr> <tr> <td class="topAlign"><tt>QWizard.CancelButtonOnLeft</tt></td> <td class="topAlign"><tt>0x00000400</tt></td> <td class="topAlign">Put the <b>Cancel</b> button on the left of <b>Back</b> (rather than on the right of <b>Finish</b> or <b>Next</b>).</td> </tr> <tr> <td class="topAlign"><tt>QWizard.HaveHelpButton</tt></td> <td class="topAlign"><tt>0x00000800</tt></td> <td class="topAlign">Show the <b>Help</b> button.</td> </tr> <tr> <td class="topAlign"><tt>QWizard.HelpButtonOnRight</tt></td> <td class="topAlign"><tt>0x00001000</tt></td> <td class="topAlign">Put the <b>Help</b> button on the far right of the button layout (rather than on the far left).</td> </tr> <tr> <td class="topAlign"><tt>QWizard.HaveCustomButton1</tt></td> <td class="topAlign"><tt>0x00002000</tt></td> <td class="topAlign">Show the first user-defined button (<a href="qwizard.html#WizardButton-enum">CustomButton1</a>).</td> </tr> <tr> <td class="topAlign"><tt>QWizard.HaveCustomButton2</tt></td> <td class="topAlign"><tt>0x00004000</tt></td> <td class="topAlign">Show the second user-defined button (<a href="qwizard.html#WizardButton-enum">CustomButton2</a>).</td> </tr> <tr> <td class="topAlign"><tt>QWizard.HaveCustomButton3</tt></td> <td class="topAlign"><tt>0x00008000</tt></td> <td class="topAlign">Show the third user-defined button (<a href="qwizard.html#WizardButton-enum">CustomButton3</a>).</td> </tr> </table> <p>The WizardOptions type is a typedef for <a href="qflags.html">QFlags</a><WizardOption>. It stores an OR combination of WizardOption values.</p> <p><b>See also</b> <a href="qwizard.html#options-prop">setOptions</a>(), <a href="qwizard.html#setOption">setOption</a>(), and <a href="qwizard.html#testOption">testOption</a>().</p> <h3 class="fn"><a name="WizardPixmap-enum" />QWizard.WizardPixmap</h3><p>This enum specifies the pixmaps that can be associated with a page.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QWizard.WatermarkPixmap</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">The tall pixmap on the left side of a <a href="qwizard.html#WizardStyle-enum">ClassicStyle</a> or <a href="qwizard.html#WizardStyle-enum">ModernStyle</a> page</td> </tr> <tr> <td class="topAlign"><tt>QWizard.LogoPixmap</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">The small pixmap on the right side of a <a href="qwizard.html#WizardStyle-enum">ClassicStyle</a> or <a href="qwizard.html#WizardStyle-enum">ModernStyle</a> page header</td> </tr> <tr> <td class="topAlign"><tt>QWizard.BannerPixmap</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">The pixmap that occupies the background of a <a href="qwizard.html#WizardStyle-enum">ModernStyle</a> page header</td> </tr> <tr> <td class="topAlign"><tt>QWizard.BackgroundPixmap</tt></td> <td class="topAlign"><tt>3</tt></td> <td class="topAlign">The pixmap that occupies the background of a <a href="qwizard.html#WizardStyle-enum">MacStyle</a> wizard</td> </tr> </table> <p><b>See also</b> <a href="qwizard.html#setPixmap">setPixmap</a>(), <a href="qwizardpage.html#setPixmap">QWizardPage.setPixmap</a>(), and <a href="qwizard.html#elements-of-a-wizard-page">Elements of a Wizard Page</a>.</p> <h3 class="fn"><a name="WizardStyle-enum" />QWizard.WizardStyle</h3><p>This enum specifies the different looks supported by <a href="qwizard.html">QWizard</a>.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QWizard.ClassicStyle</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">Classic Windows look</td> </tr> <tr> <td class="topAlign"><tt>QWizard.ModernStyle</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">Modern Windows look</td> </tr> <tr> <td class="topAlign"><tt>QWizard.MacStyle</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">Mac OS X look</td> </tr> <tr> <td class="topAlign"><tt>QWizard.AeroStyle</tt></td> <td class="topAlign"><tt>3</tt></td> <td class="topAlign">Windows Aero look</td> </tr> </table> <p><b>See also</b> <a href="qwizard.html#wizardStyle-prop">setWizardStyle</a>(), <a href="qwizard.html#WizardOption-enum">WizardOption</a>, and <a href="qwizard.html#wizard-look-and-feel">Wizard Look and Feel</a>.</p> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QWizard" />QWizard.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = 0)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a wizard with the given <i>parent</i> and window <i>flags</i>.</p> <p><b>See also</b> <a href="qobject.html#parent">parent</a>() and <a href="qwidget.html#windowFlags-prop">windowFlags</a>().</p> <h3 class="fn"><a name="addPage" />int QWizard.addPage (<i>self</i>, <a href="qwizardpage.html">QWizardPage</a> <i>page</i>)</h3><p>The <i>page</i> argument has it's ownership transferred to Qt.</p><p>Adds the given <i>page</i> to the wizard, and returns the page's ID.</p> <p>The ID is guaranteed to be larger than any other ID in the <a href="qwizard.html">QWizard</a> so far.</p> <p><b>See also</b> <a href="qwizard.html#setPage">setPage</a>(), <a href="qwizard.html#page">page</a>(), and <a href="qwizard.html#pageAdded">pageAdded</a>().</p> <h3 class="fn"><a name="back" />QWizard.back (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void back()</tt>.</p><p>Goes back to the previous page.</p> <p>This is equivalent to pressing the <b>Back</b> button.</p> <p><b>See also</b> <a href="qwizard.html#next">next</a>(), <a href="qdialog.html#accept">accept</a>(), <a href="qdialog.html#reject">reject</a>(), and <a href="qwizard.html#restart">restart</a>().</p> <h3 class="fn"><a name="button" /><a href="qabstractbutton.html">QAbstractButton</a> QWizard.button (<i>self</i>, <a href="qwizard.html#WizardButton-enum">WizardButton</a> <i>which</i>)</h3><p>Returns the button corresponding to role <i>which</i>.</p> <p><b>See also</b> <a href="qwizard.html#setButton">setButton</a>() and <a href="qwizard.html#setButtonText">setButtonText</a>().</p> <h3 class="fn"><a name="buttonText" />QString QWizard.buttonText (<i>self</i>, <a href="qwizard.html#WizardButton-enum">WizardButton</a> <i>which</i>)</h3><p>Returns the text on button <i>which</i>.</p> <p>If a text has ben set using <a href="qwizard.html#setButtonText">setButtonText</a>(), this text is returned.</p> <p>By default, the text on buttons depends on the <a href="qwizard.html#wizardStyle-prop">wizardStyle</a>. For example, on Mac OS X, the <b>Next</b> button is called <b>Continue</b>.</p> <p><b>See also</b> <a href="qwizard.html#button">button</a>(), <a href="qwizard.html#setButton">setButton</a>(), <a href="qwizard.html#setButtonText">setButtonText</a>(), <a href="qwizardpage.html#buttonText">QWizardPage.buttonText</a>(), and <a href="qwizardpage.html#setButtonText">QWizardPage.setButtonText</a>().</p> <h3 class="fn"><a name="cleanupPage" />QWizard.cleanupPage (<i>self</i>, int <i>id</i>)</h3><p>This virtual function is called by <a href="qwizard.html">QWizard</a> to clean up page <i>id</i> just before the user leaves it by clicking <b>Back</b> (unless the <a href="qwizard.html#WizardOption-enum">QWizard.IndependentPages</a> option is set).</p> <p>The default implementation calls <a href="qwizardpage.html#cleanupPage">QWizardPage.cleanupPage</a>() on page(<i>id</i>).</p> <p><b>See also</b> <a href="qwizardpage.html#cleanupPage">QWizardPage.cleanupPage</a>() and <a href="qwizard.html#initializePage">initializePage</a>().</p> <h3 class="fn"><a name="currentId" />int QWizard.currentId (<i>self</i>)</h3><h3 class="fn"><a name="currentPage" /><a href="qwizardpage.html">QWizardPage</a> QWizard.currentPage (<i>self</i>)</h3><p>Returns a pointer to the current page, or 0 if there is no current page (e.g., before the wizard is shown).</p> <p>This is equivalent to calling page(<a href="qwizard.html#currentId-prop">currentId</a>()).</p> <p><b>See also</b> <a href="qwizard.html#page">page</a>(), <a href="qwizard.html#currentId-prop">currentId</a>(), and <a href="qwizard.html#restart">restart</a>().</p> <h3 class="fn"><a name="done" />QWizard.done (<i>self</i>, int <i>result</i>)</h3><p>Reimplemented from <a href="qdialog.html#done">QDialog.done</a>().</p> <h3 class="fn"><a name="event" />bool QWizard.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p> <h3 class="fn"><a name="field" />QVariant QWizard.field (<i>self</i>, QString <i>name</i>)</h3><p>Returns the value of the field called <i>name</i>.</p> <p>This function can be used to access fields on any page of the wizard.</p> <p><b>See also</b> <a href="qwizardpage.html#registerField">QWizardPage.registerField</a>(), <a href="qwizardpage.html#field">QWizardPage.field</a>(), and <a href="qwizard.html#setField">setField</a>().</p> <h3 class="fn"><a name="hasVisitedPage" />bool QWizard.hasVisitedPage (<i>self</i>, int <i>id</i>)</h3><p>Returns true if the page history contains page <i>id</i>; otherwise, returns false.</p> <p>Pressing <b>Back</b> marks the current page as "unvisited" again.</p> <p><b>See also</b> <a href="qwizard.html#visitedPages">visitedPages</a>().</p> <h3 class="fn"><a name="initializePage" />QWizard.initializePage (<i>self</i>, int <i>id</i>)</h3><p>This virtual function is called by <a href="qwizard.html">QWizard</a> to prepare page <i>id</i> just before it is shown either as a result of <a href="qwizard.html#restart">QWizard.restart</a>() being called, or as a result of the user clicking <b>Next</b>. (However, if the <a href="qwizard.html#WizardOption-enum">QWizard.IndependentPages</a> option is set, this function is only called the first time the page is shown.)</p> <p>By reimplementing this function, you can ensure that the page's fields are properly initialized based on fields from previous pages.</p> <p>The default implementation calls <a href="qwizardpage.html#initializePage">QWizardPage.initializePage</a>() on page(<i>id</i>).</p> <p><b>See also</b> <a href="qwizardpage.html#initializePage">QWizardPage.initializePage</a>() and <a href="qwizard.html#cleanupPage">cleanupPage</a>().</p> <h3 class="fn"><a name="next" />QWizard.next (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void next()</tt>.</p><p>Advances to the next page.</p> <p>This is equivalent to pressing the <b>Next</b> or <b>Commit</b> button.</p> <p><b>See also</b> <a href="qwizard.html#nextId">nextId</a>(), <a href="qwizard.html#back">back</a>(), <a href="qdialog.html#accept">accept</a>(), <a href="qdialog.html#reject">reject</a>(), and <a href="qwizard.html#restart">restart</a>().</p> <h3 class="fn"><a name="nextId" />int QWizard.nextId (<i>self</i>)</h3><p>This virtual function is called by <a href="qwizard.html">QWizard</a> to find out which page to show when the user clicks the <b>Next</b> button.</p> <p>The return value is the ID of the next page, or -1 if no page follows.</p> <p>The default implementation calls <a href="qwizardpage.html#nextId">QWizardPage.nextId</a>() on the <a href="qwizard.html#currentPage">currentPage</a>().</p> <p>By reimplementing this function, you can specify a dynamic page order.</p> <p><b>See also</b> <a href="qwizardpage.html#nextId">QWizardPage.nextId</a>() and <a href="qwizard.html#currentPage">currentPage</a>().</p> <h3 class="fn"><a name="options" /><a href="qwizard-wizardoptions.html">WizardOptions</a> QWizard.options (<i>self</i>)</h3><h3 class="fn"><a name="page" /><a href="qwizardpage.html">QWizardPage</a> QWizard.page (<i>self</i>, int <i>id</i>)</h3><p>Returns the page with the given <i>id</i>, or 0 if there is no such page.</p> <p><b>See also</b> <a href="qwizard.html#addPage">addPage</a>() and <a href="qwizard.html#setPage">setPage</a>().</p> <h3 class="fn"><a name="pageIds" />list-of-int QWizard.pageIds (<i>self</i>)</h3><p>Returns the list of page IDs.</p> <p>This function was introduced in Qt 4.5.</p> <h3 class="fn"><a name="paintEvent" />QWizard.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p> <h3 class="fn"><a name="pixmap" /><a href="qpixmap.html">QPixmap</a> QWizard.pixmap (<i>self</i>, <a href="qwizard.html#WizardPixmap-enum">WizardPixmap</a> <i>which</i>)</h3><p>Returns the pixmap set for role <i>which</i>.</p> <p>By default, the only pixmap that is set is the <a href="qwizard.html#WizardPixmap-enum">BackgroundPixmap</a> on Mac OS X.</p> <p><b>See also</b> <a href="qwizard.html#setPixmap">setPixmap</a>(), <a href="qwizardpage.html#pixmap">QWizardPage.pixmap</a>(), and <a href="qwizard.html#elements-of-a-wizard-page">Elements of a Wizard Page</a>.</p> <h3 class="fn"><a name="removePage" />QWizard.removePage (<i>self</i>, int <i>id</i>)</h3><p>Removes the page with the given <i>id</i>. <a href="qwizard.html#cleanupPage">cleanupPage</a>() will be called if necessary.</p> <p><b>Note:</b> Removing a page may influence the value of the <a href="qwizard.html#startId-prop">startId</a> property.</p> <p>This function was introduced in Qt 4.5.</p> <p><b>See also</b> <a href="qwizard.html#addPage">addPage</a>(), <a href="qwizard.html#setPage">setPage</a>(), <a href="qwizard.html#pageRemoved">pageRemoved</a>(), and <a href="qwizard.html#startId-prop">startId</a>().</p> <h3 class="fn"><a name="resizeEvent" />QWizard.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p> <h3 class="fn"><a name="restart" />QWizard.restart (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void restart()</tt>.</p><p>Restarts the wizard at the start page. This function is called automatically when the wizard is shown.</p> <p><b>See also</b> <a href="qwizard.html#startId-prop">startId</a>().</p> <h3 class="fn"><a name="setButton" />QWizard.setButton (<i>self</i>, <a href="qwizard.html#WizardButton-enum">WizardButton</a> <i>which</i>, <a href="qabstractbutton.html">QAbstractButton</a> <i>button</i>)</h3><p>The <i>button</i> argument has it's ownership transferred to Qt.</p><p>Sets the button corresponding to role <i>which</i> to <i>button</i>.</p> <p>To add extra buttons to the wizard (e.g., a <b>Print</b> button), one way is to call setButton() with <a href="qwizard.html#WizardButton-enum">CustomButton1</a> to <a href="qwizard.html#WizardButton-enum">CustomButton3</a>, and make the buttons visible using the <a href="qwizard.html#WizardOption-enum">HaveCustomButton1</a> to <a href="qwizard.html#WizardOption-enum">HaveCustomButton3</a> options.</p> <p><b>See also</b> <a href="qwizard.html#button">button</a>(), <a href="qwizard.html#setButtonText">setButtonText</a>(), <a href="qwizard.html#setButtonLayout">setButtonLayout</a>(), and <a href="qwizard.html#options-prop">options</a>.</p> <h3 class="fn"><a name="setButtonLayout" />QWizard.setButtonLayout (<i>self</i>, list-of-QWizard.WizardButton <i>layout</i>)</h3><p>Sets the order in which buttons are displayed to <i>layout</i>, where <i>layout</i> is a list of <a href="qwizard.html#WizardButton-enum">WizardButton</a>s.</p> <p>The default layout depends on the options (e.g., whether <a href="qwizard.html#WizardOption-enum">HelpButtonOnRight</a>) that are set. You can call this function if you need more control over the buttons' layout than what <a href="qwizard.html#options-prop">options</a> already provides.</p> <p>You can specify horizontal stretches in the layout using <a href="qwizard.html#WizardButton-enum">Stretch</a>.</p> <p>Example:</p> <pre class="cpp"> MyWizard<span class="operator">.</span>MyWizard(<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) { <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span> <span class="type"><a href="qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">.</span>WizardButton<span class="operator">></span> layout; layout <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">.</span>Stretch <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">.</span>BackButton <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">.</span>CancelButton <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">.</span>NextButton <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qwizard.html">QWizard</a></span><span class="operator">.</span>FinishButton; setButtonLayout(layout); <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span> } </pre> <p><b>See also</b> <a href="qwizard.html#setButton">setButton</a>(), <a href="qwizard.html#setButtonText">setButtonText</a>(), and <a href="qwizard.html#options-prop">setOptions</a>().</p> <h3 class="fn"><a name="setButtonText" />QWizard.setButtonText (<i>self</i>, <a href="qwizard.html#WizardButton-enum">WizardButton</a> <i>which</i>, QString <i>text</i>)</h3><p>Sets the text on button <i>which</i> to be <i>text</i>.</p> <p>By default, the text on buttons depends on the <a href="qwizard.html#wizardStyle-prop">wizardStyle</a>. For example, on Mac OS X, the <b>Next</b> button is called <b>Continue</b>.</p> <p>To add extra buttons to the wizard (e.g., a <b>Print</b> button), one way is to call setButtonText() with <a href="qwizard.html#WizardButton-enum">CustomButton1</a>, <a href="qwizard.html#WizardButton-enum">CustomButton2</a>, or <a href="qwizard.html#WizardButton-enum">CustomButton3</a> to set their text, and make the buttons visible using the <a href="qwizard.html#WizardOption-enum">HaveCustomButton1</a>, <a href="qwizard.html#WizardOption-enum">HaveCustomButton2</a>, and/or <a href="qwizard.html#WizardOption-enum">HaveCustomButton3</a> options.</p> <p>Button texts may also be set on a per-page basis using <a href="qwizardpage.html#setButtonText">QWizardPage.setButtonText</a>().</p> <p><b>See also</b> <a href="qwizard.html#buttonText">buttonText</a>(), <a href="qwizard.html#setButton">setButton</a>(), <a href="qwizard.html#button">button</a>(), <a href="qwizard.html#setButtonLayout">setButtonLayout</a>(), <a href="qwizard.html#options-prop">setOptions</a>(), and <a href="qwizardpage.html#setButtonText">QWizardPage.setButtonText</a>().</p> <h3 class="fn"><a name="setDefaultProperty" />QWizard.setDefaultProperty (<i>self</i>, str <i>className</i>, str <i>property</i>, str <i>changedSignal</i>)</h3><p>Sets the default property for <i>className</i> to be <i>property</i>, and the associated change signal to be <i>changedSignal</i>.</p> <p>The default property is used when an instance of <i>className</i> (or of one of its subclasses) is passed to <a href="qwizardpage.html#registerField">QWizardPage.registerField</a>() and no property is specified.</p> <p><a href="qwizard.html">QWizard</a> knows the most common Qt widgets. For these (or their subclasses), you don't need to specify a <i>property</i> or a <i>changedSignal</i>. The table below lists these widgets:</p> <table class="generic"> <thead> <tr class="qt-style"> <th>Widget</th> <th>Property</th> <th>Change Notification Signal</th> </tr> </thead> <tr class="odd" valign="top"> <td><a href="qabstractbutton.html">QAbstractButton</a></td> <td>bool <a href="qabstractbutton.html#checked-prop">checked</a></td> <td><a href="qabstractbutton.html#toggled">toggled()</a></td> </tr> <tr class="even" valign="top"> <td><a href="qabstractslider.html">QAbstractSlider</a></td> <td>int <a href="qabstractslider.html#value-prop">value</a></td> <td><a href="qabstractslider.html#valueChanged">valueChanged()</a></td> </tr> <tr class="odd" valign="top"> <td><a href="qcombobox.html">QComboBox</a></td> <td>int <a href="qcombobox.html#currentIndex-prop">currentIndex</a></td> <td><a href="qcombobox.html#currentIndexChanged">currentIndexChanged()</a></td> </tr> <tr class="even" valign="top"> <td><a href="qdatetimeedit.html">QDateTimeEdit</a></td> <td><a href="qdatetime.html">QDateTime</a> <a href="qdatetimeedit.html#dateTime-prop">dateTime</a></td> <td><a href="qdatetimeedit.html#dateTimeChanged">dateTimeChanged()</a></td> </tr> <tr class="odd" valign="top"> <td><a href="qlineedit.html">QLineEdit</a></td> <td><a href="qstring.html">QString</a> <a href="qlineedit.html#text-prop">text</a></td> <td><a href="qlineedit.html#textChanged">textChanged()</a></td> </tr> <tr class="even" valign="top"> <td><a href="qlistwidget.html">QListWidget</a></td> <td>int <a href="qlistwidget.html#currentRow-prop">currentRow</a></td> <td><a href="qlistwidget.html#currentRowChanged">currentRowChanged()</a></td> </tr> <tr class="odd" valign="top"> <td><a href="qspinbox.html">QSpinBox</a></td> <td>int <a href="qspinbox.html#value-prop">value</a></td> <td><a href="qspinbox.html#valueChanged">valueChanged()</a></td> </tr> </table> <p><b>See also</b> <a href="qwizardpage.html#registerField">QWizardPage.registerField</a>().</p> <h3 class="fn"><a name="setField" />QWizard.setField (<i>self</i>, QString <i>name</i>, QVariant <i>value</i>)</h3><p>Sets the value of the field called <i>name</i> to <i>value</i>.</p> <p>This function can be used to set fields on any page of the wizard.</p> <p><b>See also</b> <a href="qwizardpage.html#registerField">QWizardPage.registerField</a>(), <a href="qwizardpage.html#setField">QWizardPage.setField</a>(), and <a href="qwizard.html#field">field</a>().</p> <h3 class="fn"><a name="setOption" />QWizard.setOption (<i>self</i>, <a href="qwizard.html#WizardOption-enum">WizardOption</a> <i>option</i>, bool <i>on</i> = True)</h3><p>Sets the given <i>option</i> to be enabled if <i>on</i> is true; otherwise, clears the given <i>option</i>.</p> <p><b>See also</b> <a href="qwizard.html#options-prop">options</a>, <a href="qwizard.html#testOption">testOption</a>(), and <a href="qwizard.html#wizardStyle-prop">setWizardStyle</a>().</p> <h3 class="fn"><a name="setOptions" />QWizard.setOptions (<i>self</i>, <a href="qwizard-wizardoptions.html">WizardOptions</a> <i>options</i>)</h3><h3 class="fn"><a name="setPage" />QWizard.setPage (<i>self</i>, int <i>id</i>, <a href="qwizardpage.html">QWizardPage</a> <i>page</i>)</h3><p>The <i>page</i> argument has it's ownership transferred to Qt.</p><p>Adds the given <i>page</i> to the wizard with the given <i>id</i>.</p> <p><b>Note:</b> Adding a page may influence the value of the <a href="qwizard.html#startId-prop">startId</a> property in case it was not set explicitly.</p> <p><b>See also</b> <a href="qwizard.html#addPage">addPage</a>(), <a href="qwizard.html#page">page</a>(), and <a href="qwizard.html#pageAdded">pageAdded</a>().</p> <h3 class="fn"><a name="setPixmap" />QWizard.setPixmap (<i>self</i>, <a href="qwizard.html#WizardPixmap-enum">WizardPixmap</a> <i>which</i>, <a href="qpixmap.html">QPixmap</a> <i>pixmap</i>)</h3><p>Sets the pixmap for role <i>which</i> to <i>pixmap</i>.</p> <p>The pixmaps are used by <a href="qwizard.html">QWizard</a> when displaying a page. Which pixmaps are actually used depend on the <a href="qwizard.html#wizard-look-and-feel">wizard style</a>.</p> <p>Pixmaps can also be set for a specific page using <a href="qwizardpage.html#setPixmap">QWizardPage.setPixmap</a>().</p> <p><b>See also</b> <a href="qwizard.html#pixmap">pixmap</a>(), <a href="qwizardpage.html#setPixmap">QWizardPage.setPixmap</a>(), and <a href="qwizard.html#elements-of-a-wizard-page">Elements of a Wizard Page</a>.</p> <h3 class="fn"><a name="setSideWidget" />QWizard.setSideWidget (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>The <i>widget</i> argument has it's ownership transferred to Qt.</p><p>Sets the given <i>widget</i> to be shown on the left side of the wizard. For styles which use the <a href="qwizard.html#WizardPixmap-enum">WatermarkPixmap</a> (<a href="qwizard.html#WizardStyle-enum">ClassicStyle</a> and <a href="qwizard.html#WizardStyle-enum">ModernStyle</a>) the side widget is displayed on top of the watermark, for other styles or when the watermark is not provided the side widget is displayed on the left side of the wizard.</p> <p>Passing 0 shows no side widget.</p> <p>When the <i>widget</i> is not 0 the wizard reparents it.</p> <p>Any previous side widget is hidden.</p> <p>You may call setSideWidget() with the same widget at different times.</p> <p>All widgets set here will be deleted by the wizard when it is destroyed unless you separately reparent the widget after setting some other side widget (or 0).</p> <p>By default, no side widget is present.</p> <p>This function was introduced in Qt 4.7.</p> <p><b>See also</b> <a href="qwizard.html#sideWidget">sideWidget</a>().</p> <h3 class="fn"><a name="setStartId" />QWizard.setStartId (<i>self</i>, int <i>id</i>)</h3><h3 class="fn"><a name="setSubTitleFormat" />QWizard.setSubTitleFormat (<i>self</i>, <a href="qt.html#TextFormat-enum">Qt.TextFormat</a> <i>format</i>)</h3><h3 class="fn"><a name="setTitleFormat" />QWizard.setTitleFormat (<i>self</i>, <a href="qt.html#TextFormat-enum">Qt.TextFormat</a> <i>format</i>)</h3><h3 class="fn"><a name="setVisible" />QWizard.setVisible (<i>self</i>, bool <i>visible</i>)</h3><p>Reimplemented from <a href="qwidget.html#visible-prop">QWidget.setVisible</a>().</p> <h3 class="fn"><a name="setWizardStyle" />QWizard.setWizardStyle (<i>self</i>, <a href="qwizard.html#WizardStyle-enum">WizardStyle</a> <i>style</i>)</h3><h3 class="fn"><a name="sideWidget" /><a href="qwidget.html">QWidget</a> QWizard.sideWidget (<i>self</i>)</h3><p>Returns the widget on the left side of the wizard or 0.</p> <p>By default, no side widget is present.</p> <p>This function was introduced in Qt 4.7.</p> <p><b>See also</b> <a href="qwizard.html#setSideWidget">setSideWidget</a>().</p> <h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QWizard.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p> <h3 class="fn"><a name="startId" />int QWizard.startId (<i>self</i>)</h3><h3 class="fn"><a name="subTitleFormat" /><a href="qt.html#TextFormat-enum">Qt.TextFormat</a> QWizard.subTitleFormat (<i>self</i>)</h3><h3 class="fn"><a name="testOption" />bool QWizard.testOption (<i>self</i>, <a href="qwizard.html#WizardOption-enum">WizardOption</a> <i>option</i>)</h3><p>Returns true if the given <i>option</i> is enabled; otherwise, returns false.</p> <p><b>See also</b> <a href="qwizard.html#options-prop">options</a>, <a href="qwizard.html#setOption">setOption</a>(), and <a href="qwizard.html#wizardStyle-prop">setWizardStyle</a>().</p> <h3 class="fn"><a name="titleFormat" /><a href="qt.html#TextFormat-enum">Qt.TextFormat</a> QWizard.titleFormat (<i>self</i>)</h3><h3 class="fn"><a name="validateCurrentPage" />bool QWizard.validateCurrentPage (<i>self</i>)</h3><p>This virtual function is called by <a href="qwizard.html">QWizard</a> when the user clicks <b>Next</b> or <b>Finish</b> to perform some last-minute validation. If it returns true, the next page is shown (or the wizard finishes); otherwise, the current page stays up.</p> <p>The default implementation calls <a href="qwizardpage.html#validatePage">QWizardPage.validatePage</a>() on the <a href="qwizard.html#currentPage">currentPage</a>().</p> <p>When possible, it is usually better style to disable the <b>Next</b> or <b>Finish</b> button (by specifying <a href="qwizard.html#mandatory-fields">mandatory fields</a> or by reimplementing <a href="qwizardpage.html#isComplete">QWizardPage.isComplete</a>()) than to reimplement validateCurrentPage().</p> <p><b>See also</b> <a href="qwizardpage.html#validatePage">QWizardPage.validatePage</a>() and <a href="qwizard.html#currentPage">currentPage</a>().</p> <h3 class="fn"><a name="visitedPages" />list-of-int QWizard.visitedPages (<i>self</i>)</h3><p>Returns the list of IDs of visited pages, in the order in which the pages were visited.</p> <p>Pressing <b>Back</b> marks the current page as "unvisited" again.</p> <p><b>See also</b> <a href="qwizard.html#hasVisitedPage">hasVisitedPage</a>().</p> <h3 class="fn"><a name="wizardStyle" /><a href="qwizard.html#WizardStyle-enum">WizardStyle</a> QWizard.wizardStyle (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="currentIdChanged" />void currentIdChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the current page changes, with the new current <i>id</i>.</p> <p><b>See also</b> <a href="qwizard.html#currentId-prop">currentId</a>() and <a href="qwizard.html#currentPage">currentPage</a>().</p> <h3 class="fn"><a name="customButtonClicked" />void customButtonClicked (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the user clicks a custom button. <i>which</i> can be <a href="qwizard.html#WizardButton-enum">CustomButton1</a>, <a href="qwizard.html#WizardButton-enum">CustomButton2</a>, or <a href="qwizard.html#WizardButton-enum">CustomButton3</a>.</p> <p>By default, no custom button is shown. Call <a href="qwizard.html#setOption">setOption</a>() with <a href="qwizard.html#WizardOption-enum">HaveCustomButton1</a>, <a href="qwizard.html#WizardOption-enum">HaveCustomButton2</a>, or <a href="qwizard.html#WizardOption-enum">HaveCustomButton3</a> to have one, and use <a href="qwizard.html#setButtonText">setButtonText</a>() or <a href="qwizard.html#setButton">setButton</a>() to configure it.</p> <p><b>See also</b> <a href="qwizard.html#helpRequested">helpRequested</a>().</p> <h3 class="fn"><a name="helpRequested" />void helpRequested ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the user clicks the <b>Help</b> button.</p> <p>By default, no <b>Help</b> button is shown. Call setOption(<a href="qwizard.html#WizardOption-enum">HaveHelpButton</a>, true) to have one.</p> <p>Example:</p> <pre class="cpp"> LicenseWizard<span class="operator">.</span>LicenseWizard(<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) { ... setOption(HaveHelpButton<span class="operator">,</span> <span class="keyword">true</span>); connect(<span class="keyword">this</span><span class="operator">,</span> SIGNAL(helpRequested())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(showHelp())); ... } <span class="type">void</span> LicenseWizard<span class="operator">.</span>showHelp() { <span class="keyword">static</span> <span class="type"><a href="qstring.html">QString</a></span> lastHelpMessage; <span class="type"><a href="qstring.html">QString</a></span> message; <span class="keyword">switch</span> (currentId()) { <span class="keyword">case</span> Page_Intro: message <span class="operator">=</span> tr(<span class="string">"The decision you make here will affect which page you "</span> <span class="string">"get to see next."</span>); <span class="keyword">break</span>; ... <span class="keyword">default</span>: message <span class="operator">=</span> tr(<span class="string">"This help is likely not to be of any help."</span>); } <span class="type"><a href="qmessagebox.html">QMessageBox</a></span><span class="operator">.</span>information(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"License Wizard Help"</span>)<span class="operator">,</span> message); } </pre> <p><b>See also</b> <a href="qwizard.html#customButtonClicked">customButtonClicked</a>().</p> <h3 class="fn"><a name="pageAdded" />void pageAdded (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever a page is added to the wizard. The page's <i>id</i> is passed as parameter.</p> <p>This function was introduced in Qt 4.7.</p> <p><b>See also</b> <a href="qwizard.html#addPage">addPage</a>(), <a href="qwizard.html#setPage">setPage</a>(), and <a href="qwizard.html#startId-prop">startId</a>().</p> <h3 class="fn"><a name="pageRemoved" />void pageRemoved (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever a page is removed from the wizard. The page's <i>id</i> is passed as parameter.</p> <p>This function was introduced in Qt 4.7.</p> <p><b>See also</b> <a href="qwizard.html#removePage">removePage</a>() and <a href="qwizard.html#startId-prop">startId</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>