aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/qtquick/qtquick-creating.qdoc
blob: 7b1e09a09c76a1fc5eda21dc4576648f56e28f1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

/*!

    \contentspage {Qt Creator Manual}
    \previouspage creator-visual-editor.html
    \page quick-projects.html
    \nextpage creator-quick-ui-forms.html

    \title Creating Qt Quick Projects

    \image qmldesigner-new-project.png "New File or Project dialog"

    When you create a new Qt Quick project from scratch, you have the following
    options:

    \list

        \li \uicontrol {Qt Quick Application} creates a Qt Quick 2 application
            project that can contain both QML and C++ code. The project includes
            a QQuickView. You can build the application and deploy it to desktop,
            embedded, and mobile target platforms.

        \li \uicontrol {Qt Quick Controls Application},
            \uicontrol {Qt Quick Controls 2 Application}, and
            \uicontrol {Qt Labs Controls Application} are like
            \uicontrol {Qt Quick Application}, but using
            \l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
            {Qt Quick Controls 2} (requires Qt 5.7 or later),
            \l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
            {Qt Quick Controls}, or
            \l{http://doc.qt.io/qt-5/qtlabscontrols-index.html}
            {Qt Labs Controls} (only for Qt 5.6)

        \li \uicontrol {Qt Canvas 3D Application} creates a Qt Quick application
            that imports the Qt Canvas 3D module and, optionally, includes
            \l{http://threejs.org}{three.js}.

        \li \uicontrol {Qt Quick UI} (in the \uicontrol {Other Project}
            category) creates a Qt Quick UI project with a single QML file that
            contains the main view. You can review Qt Quick UI projects in a
            \l{Previewing QML Files}{preview tool} and you need not build them.
            They do not contain any C++ code.

        \li \uicontrol {Qt Quick Controls UI} is like \uicontrol {Qt Quick UI},
            but using Qt Quick Controls.

        \li \uicontrol {Qt Quick Extension Plugins} (in the \uicontrol Library category)
            create C++ plugins that make it possible to offer extensions that
            can be loaded dynamically into Qt Quick applications. Select
            \uicontrol {Qt Quick 1 Extension Plugin} to create extensions for
            Qt Quick 1 applications and \uicontrol {Qt Quick 2 Extension Plugin} to
            create extensions for Qt Quick 2 applications.

    \endlist

    \section1 Creating Qt Quick Applications

    \list 1

        \li Select \uicontrol File > \uicontrol {New File or Project} >
            \uicontrol Application > \uicontrol {Qt Quick Application},
            \uicontrol {Qt Quick Controls Application}, or
            \uicontrol {Qt Labs Controls Application} > \uicontrol Choose.

        \li For some Qt Quick applications, you must select the Qt version to
            develop with in the \uicontrol {Minimal required Qt version} field.
            The Qt version determines the Qt Quick imports that are used in the
            QML files.

        \li For some Qt Quick applications, you can select the
            \uicontrol {With .ui.qml file} check box to create an UI
            form that can contain a subset of the QML language. Similarly as
            with the UI forms for \QD, it is recommended that you use \QMLD to
            edit the UI forms. For more information, see \l{Qt Quick UI Forms}.

        \li For some Qt Quick applications, you can also select the
            \uicontrol {Enable native styling} check box. \QC adds a dependency
            to the Qt Widgets module to the \c .pro file.

        \li Select \l{glossary-buildandrun-kit}{kits} for running and building
            your project, and then click \uicontrol Next.

            \note Kits are listed if they have been specified in
            \uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} >
            \uicontrol Kits.

        \li Review the project settings, and click \uicontrol Finish (on Windows
            and Linux) or \uicontrol Done (on OS X) to create the project.

    \endlist

    \note The SDK for a particular target platform might install additional
    templates for that platform. For example, the QNX templates are installed
    as part of the QNX SDK.

    \QC creates the necessary boilerplate files. Some of the files are
    specific to a particular target platform.

    \section1 Creating Qt Quick UI Projects

    \list 1

        \li Select \uicontrol File > \uicontrol {New File or Project} >
            \uicontrol {Other Project} > \uicontrol {Qt Quick UI} or
            \uicontrol {Qt Quick Controls UI} > \uicontrol Choose.

        \li In the \uicontrol {Minimal required Qt version} field, select the Qt
            version to develop with. The Qt version determines the Qt Quick
            imports that are used in the QML files.

            You can add imports later to combine Qt Quick basic types with
            Qt Quick Controls, Qt Quick Dialogs, and Qt Quick Layouts (available
            since Qt 5.1).

        \li Select the \uicontrol {With .ui.qml file} check box to create an UI
            form.

    \endlist

    \QC creates the following files:

    \list

        \li .qmlproject project file defines that all QML, JavaScript, and image
            files in the project folder belong to the project. Therefore, you do
            not need to individually list all the files in the project.

        \li .qml file defines an UI item, such as a component, screen, or the
            whole application UI.

        \li ui.qml file defines a form for the application UI. This file is
            created if you selected the \uicontrol {With .ui.qml file} check
            box.

    \endlist

    To use JavaScript and image files in the application, copy them to the
    project folder.

*/