Update copyright headers
[qt:qt.git] / doc / src / examples / trivialwizard.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
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.
16 **
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.
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29     \example dialogs/trivialwizard
30     \title Trivial Wizard Example
31
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
34     of QWizard.
35
36     \image trivialwizard-example-flow.png
37
38     \section1 Introduction Page
39
40     \image trivialwizard-example-introduction.png
41
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.
47
48     \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 0
49
50     \section1 Registration Page
51
52     \image trivialwizard-example-registration.png
53
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
57     QLineEdit objects.
58
59     \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 2
60
61     \section1 Conclusion Page
62
63     \image trivialwizard-example-conclusion.png
64
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.
69
70     \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 6
71
72     \section1 \c main() Function
73
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
77     it.
78
79     \snippet examples/dialogs/trivialwizard/trivialwizard.cpp 10
80
81     \sa QWizard, {Class Wizard Example}, {License Wizard Example}
82 */