Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtqml.qdoc
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qtqml-index.html
6\meta {keywords} {qmltopic}
7\title Qt Qml
8\brief The Qt Qml module implements the QML language and offers APIs to register
9 types for it.
10
11The Qt Qml module provides a framework for developing applications and libraries
12with the \l{The QML Reference}{QML language}. It defines and implements the
13language and engine infrastructure, and provides an API to enable application
14developers to \l{Registering QML Types and QML Modules}{register} custom QML types
15and modules and integrate QML code with JavaScript and C++. The Qt Qml module
16provides both a \l{Qt Qml QML Types}{QML API} and a
17\l{Qt Qml C++ Classes}{C++ API}.
18
19\section1 Using the Module
20
21\section2 QML API
22
23\include {module-use.qdocinc} {using the qml api} {QtQml}
24
25The Qt Qml module contains the QML framework and important QML types used in
26applications. The constructs of QML are described in the \l{The QML Reference}.
27
28The \l{Qt Qml QML Types}{QML API} of the Qt Qml module provides a number of
29\l{qtqml-typesystem-objecttypes.html}{QML Object Types},
30\l{qtqml-typesystem-valuetypes.html}{QML Value Types} and namespaces.
31
32\section2 C++ API
33
34\include {module-use.qdocinc} {using the c++ api}
35
36The C++ API contains some
37\l{Important C++ Classes Provided By The Qt Qml Module}{important classes}
38you should get familiar with. It also provides
39\l{Integrating with JavaScript values from C++}{types} to hold JavaScript
40values.
41
42\section3 Building with CMake
43
44\include {module-use.qdocinc} {building with cmake} {Qml}
45
46To provide foreign QML type support for a non-QML library, locate
47the \c QmlIntegration module as follows:
48
49\snippet code/doc_src_qtqml.cmake 1
50
51See \l{qt6_generate_foreign_qml_types} for details.
52
53\section3 Building with qmake
54
55\include {module-use.qdocinc} {building_with_qmake} {qml}
56
57\section1 Registering QML Types and QML Modules
58
59In order to register types for usage with QML you first need to define a
60\l{Writing QML Modules}{QML module}, preferably using \l{qt_add_qml_module} in CMake.
61Then, you can add C++ headers to your new module, and
62\l{Defining QML Types from C++}{define types} to be
63\l{Exposing Attributes of C++ Types to QML}{exposed to QML} in them.
64
65\section1 Tweaking the engine
66
67There are a number of knobs you can turn to customize the behavior of the QML engine.
68The page on \l{Configuring the JavaScript Engine}{configuring the JavaScript engine}
69lists the environment variables you may use to this effect. The description of the
70\l{The QML Disk Cache}{QML Disk Cache} describes the options related to how your QML
71components are compiled and loaded.
72
73\section1 Articles and Guides
74
75These articles contain information about Qt Qml.
76
77\list
78 \li \l{The QML Reference}
79 \li \l{Qt Qml Tooling}
80 \li \l{Writing QML Modules}
81 \li \l{Singletons in QML}
82\endlist
83
84\section1 Reference
85
86\list
87 \li \l {Qt Qml C++ Classes} {C++ Classes}
88 \li \l {Qt Qml QML Types} {QML Types}
89\endlist
90
91\section1 Licenses and Attributions
92
93Qt Qml is available under commercial licenses from \l{The Qt Company}.
94In addition, it is available under free software licenses. Since Qt 5.4,
95these free software licenses are
96\l{GNU Lesser General Public License, version 3}, or
97the \l{GNU General Public License, version 2}.
98See \l{Qt Licensing} for further details.
99
100Furthermore Qt Qml in Qt \QtVersion may contain third party
101modules under following permissive licenses:
102
103\annotatedlist attributions-qtqml
104
105*/