aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/qtqml.qdoc
blob: 51a638bf4da1995979b3c35484b1f407de75a91a (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qtqml-index.html
\title Qt Qml
\brief The Qt Qml module implements the QML language and offers APIs to register
       types for it.

The Qt Qml module provides a framework for developing applications and libraries
with the \l{The QML Reference}{QML language}. It defines and implements the
language and engine infrastructure, and provides an API to enable application
developers to \l{Registering QML Types and QML Modules}{register} custom QML types
and modules and integrate QML code with JavaScript and C++. The Qt Qml module
provides both a \l{Qt QML QML Types}{QML API} and a
\l{Qt Qml C++ Classes}{C++ API}.

\section1 Using the Module

\section2 QML API

\include {module-use.qdocinc} {using the qml api} {QtQml}

The Qt QML module contains the QML framework and important QML types used in
applications. The constructs of QML are described in the \l{The QML Reference}.

The \l{Qt QML QML Types}{QML API} of the Qt QML module provides a number of
\l{qtqml-typesystem-objecttypes.html}{QML Object Types},
\l{qtqml-typesystem-valuetypes.html}{QML Value Types} and namespaces.

\section2 C++ API

\include {module-use.qdocinc} {using the c++ api}

The C++ API contains some
\l{Important C++ Classes Provided By The Qt QML Module}{important classes}
you should get familiar with. It also provides
\l{Integrating with JavaScript values from C++}{types} to hold JavaScript
values.

\section3 Building with CMake

\include {module-use.qdocinc} {building with cmake} {Qml}

To provide foreign QML type support for a non-QML library, locate
the \c QmlIntegration module as follows:

\snippet code/doc_src_qtqml.cmake 1

See \l{qt6_generate_foreign_qml_types} for details.

\section3 Building with qmake

\include {module-use.qdocinc} {building_with_qmake} {qml}

\section1 Registering QML Types and QML Modules

In order to register types for usage with QML you first need to define a
\l{Writing QML Modules}{QML module}, preferably using \l{qt_add_qml_module} in CMake.
Then, you can add C++ headers to your new module, and
\l{Defining QML Types from C++}{define types} to be
\l{Exposing Attributes of C++ Types to QML}{exposed to QML} in them.

\section1 Tweaking the engine

There are a number of knobs you can turn to customize the behavior of the QML engine.
The page on \l{Configuring the JavaScript Engine}{configuring the JavaScript engine}
lists the environment variables you may use to this effect. The description of the
\l{The QML Disk Cache}{QML Disk Cache} describes the options related to how your QML
components are compiled and loaded.

\section1 Articles and Guides

These articles contain information about Qt Qml.

\list
    \li \l{The QML Reference}
    \li \l{Qt Qml Tooling}
    \li \l{Writing QML Modules}
    \li \l{Singletons in QML}
\endlist

\section1 Reference

\list
    \li \l {Qt QML C++ Classes} {C++ Classes}
    \li \l {Qt QML QML Types} {QML Types}
\endlist

\section1 Licenses and Attributions

Qt QML is available under commercial licenses from \l{The Qt Company}.
In addition, it is available under free software licenses. Since Qt 5.4,
these free software licenses are
\l{GNU Lesser General Public License, version 3}, or
the \l{GNU General Public License, version 2}.
See \l{Qt Licensing} for further details.

Furthermore Qt QML in Qt \QtVersion may contain third party
modules under following permissive licenses:

\generatelist{groupsbymodule attributions-qtqml}

*/