1 /****************************************************************************
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
6 ** This file is part of the documentation of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
17 ** GNU Free Documentation License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Free
19 ** Documentation License version 1.3 as published by the Free Software
20 ** Foundation and appearing in the file included in the packaging of
21 ** this file. Please review the following information to ensure
22 ** the GNU Free Documentation License version 1.3 requirements
23 ** will be met: http://www.gnu.org/copyleft/fdl.html.
26 ****************************************************************************/
29 \example dialogs/trivialwizard
30 \title Trivial Wizard Example
32 \brief The Trivial Wizard example illustrates how to create a linear three-page
33 registration wizard using three instances of QWizardPage and one instance
36 \image trivialwizard-example-flow.png
38 \section1 Introduction Page
40 \image trivialwizard-example-introduction.png
42 The introduction page is created with the \c createIntroPage()
43 function where a QWizardPage is created and its title is set to
44 "Introduction". A QLabel is used to hold the description of \c page.
45 A QVBoxLayout is used to hold the \c label. This \c page is returned
46 when the \c createIntroPage() function is called.
48 \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 0
50 \section1 Registration Page
52 \image trivialwizard-example-registration.png
54 The registration page is created with the \c createRegistrationPage()
55 function. QLineEdit objects are used to allow the user to input a name
56 and an e-mail address. A QGridLayout is used to hold the QLabel and
59 \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 2
61 \section1 Conclusion Page
63 \image trivialwizard-example-conclusion.png
65 The conclusion page is created in the \c createConclusionPage()
66 function. This function's content is similar to \c createIntroPage(). A
67 QLabel is used to inform the user that the registration process has
68 completed successfully.
70 \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 6
72 \section1 \c main() Function
74 The \c main() function instantiates a QWizard object, \c wizard, and
75 adds all three QWizardPage objects to it. The \c wizard window title is
76 set to "Trivial Wizard" and its \c show() function is invoked to display
79 \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 10
81 \sa QWizard, {Class Wizard Example}, {License Wizard Example}