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
qt_add_qml_module.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt-add-qml-module.html
6
\ingroup cmake-commands-qtqml
7
8
\title qt_add_qml_module
9
\keyword qt6_add_qml_module
10
11
\summary{Defines a QML module.}
12
13
\cmakecommandsince 6.2
14
15
\include cmake-find-package-qml.qdocinc
16
17
\section1 Synopsis
18
19
\badcode
20
qt_add_qml_module(
21
target
22
URI uri
23
[VERSION version]
24
[PAST_MAJOR_VERSIONS ...]
25
[STATIC | SHARED]
26
[PLUGIN_TARGET plugin_target]
27
[OUTPUT_DIRECTORY output_dir]
28
[RESOURCE_PREFIX resource_prefix]
29
[CLASS_NAME class_name]
30
[TYPEINFO typeinfo]
31
[IMPORTS ...]
32
[OPTIONAL_IMPORTS ...]
33
[DEFAULT_IMPORTS ...]
34
[DEPENDENCIES ...]
35
[IMPORT_PATH ...]
36
[SOURCES ...]
37
[QML_FILES ...]
38
[RESOURCES ...]
39
[OUTPUT_TARGETS out_targets_var]
40
[DESIGNER_SUPPORTED]
41
[FOLLOW_FOREIGN_VERSIONING]
42
[NAMESPACE namespace]
43
[NO_PLUGIN]
44
[NO_PLUGIN_OPTIONAL]
45
[NO_CREATE_PLUGIN_TARGET]
46
[NO_GENERATE_PLUGIN_SOURCE]
47
[NO_GENERATE_QMLTYPES]
48
[NO_GENERATE_QMLDIR]
49
[NO_GENERATE_EXTRA_QMLDIRS]
50
[NO_GENERATE_QTCONF]
51
[NO_GENERATE_AOT_VALIDATION]
52
[NO_LINT]
53
[NO_CACHEGEN]
54
[NO_RESOURCE_TARGET_PATH]
55
[NO_IMPORT_SCAN]
56
[DISCARD_QML_CONTENTS]
57
[ENABLE_TYPE_COMPILER]
58
[TYPE_COMPILER_NAMESPACE namespace]
59
[QMLTC_EXPORT_DIRECTIVE export_macro]
60
[QMLTC_EXPORT_FILE_NAME header_defining_export_macro]
61
62
)
63
64
\endcode
65
66
\versionlessCMakeCommandsNote qt6_add_qml_module()
67
68
See \l {Building a QML application} and \l {Building a reusable QML module}
69
for examples that define QML modules.
70
71
\section1 Description
72
73
This command defines a QML module that can consist of C++ sources, \c{.qml}
74
files, or both. It ensures that essential module details are provided and that
75
they are consistent. It also sets up and coordinates things like cached
76
compilation of \c{.qml} sources, resource embedding, linting checks, and
77
auto-generation of some key module files.
78
79
For a conceptual overview with common usage examples, see
80
\l{Tying it all together with CMake}. For advanced topics like custom
81
directory layouts and versioning, see \l{Writing QML Modules}.
82
83
\section2 Target Structure
84
85
A QML module can be structured in a few different ways. The following scenarios
86
are the typical arrangements:
87
88
\section3 Separate backing and plugin targets
89
90
This is the recommended arrangement for most QML modules. All of the module's
91
functionality is implemented in the \e backing target, which is given as the
92
first command argument. C++ sources, \c{.qml} files, and resources should all
93
be added to the backing target. The backing target is a library that should be
94
installed in the same location as any other library defined by the project.
95
96
The source directory structure under which the backing target is created should
97
match the target path of the QML module (the target path is the module's URI
98
with dots replaced by forward slashes). If the source directory structure
99
doesn't match the target path, \c{qt_add_qml_module()} will issue a warning.
100
101
The following example shows a suitable source directory structure for a QML
102
module with a URI of \c{MyThings.Panels}. The call to \c{qt_add_qml_module()}
103
would be in the \c{CMakeLists.txt} file shown.
104
105
\badcode
106
src
107
+-- MyThings
108
+-- Panels
109
+-- CMakeLists.txt
110
\endcode
111
112
A separate \e plugin target is associated with the QML module. It is used at
113
runtime to load the module dynamically when the application doesn't already
114
link to the backing target. The plugin target will also be a library and is
115
normally installed to the same directory as the module's
116
\l{Module Definition qmldir Files}{qmldir} file.
117
118
The plugin target should ideally contain nothing more than a trivial
119
implementation of the plugin class. This allows the plugin to be designated as
120
optional in the \c qmldir file. Other targets can then link directly to the
121
backing target and the plugin will not be needed at runtime, which can improve
122
load-time performance. By default, a C++ source file that defines a minimal
123
plugin class will be automatically generated and added to the plugin target.
124
For cases where the QML module needs a custom plugin class implementation, the
125
\l{NO_GENERATE_PLUGIN_SOURCE} and usually the \l{NO_PLUGIN_OPTIONAL} options
126
will be needed.
127
128
The \c STATIC QML modules also generate the static QML plugins if
129
\c NO_PLUGIN is not specified. Targets that import such \c STATIC QML modules
130
also need to explicitly link to corresponding QML plugins.
131
132
\note
133
When using static linking, it might be necessary to use
134
\l {Q_IMPORT_QML_PLUGIN} to ensure that the QML plugin is correctly linked.
135
136
\section3 Plugin target with no backing target
137
138
A QML module can be defined with the plugin target serving as its own backing
139
target. In this case, the module must be loaded dynamically at runtime and
140
cannot be linked to directly by other targets. To create this arrangement,
141
the \c PLUGIN_TARGET keyword must be used, with the \c target repeated as the
142
plugin target name. For example:
143
144
\badcode
145
qt_add_qml_module(someTarget
146
PLUGIN_TARGET someTarget
147
...
148
)
149
\endcode
150
151
While this arrangement may seem marginally simpler to deploy, a separate
152
backing target should be preferred where possible due to the potentially better
153
load-time performance.
154
155
\section3 Executable as a QML module
156
157
An executable target can act as a backing target for a QML module. In this case,
158
there will be no plugin library, since the QML module will always be loaded
159
directly as part of the application. The \c{qt_add_qml_module()} command will
160
detect when an executable is used as the backing target and will automatically
161
disable the creation of a separate plugin. Do not use any of the options with
162
\c{PLUGIN} in their name when using this arrangement.
163
164
When an executable is used as the backing target, the source directory structure
165
is not expected to match the QML module's target path.
166
See \l{qmlcachegen-auto}{Caching compiled QML sources} for additional target
167
path differences for compiled-in resources.
168
169
170
\target qmldir-autogeneration
171
\section2 Auto-generating \c{qmldir} and typeinfo files
172
173
By default, a \l{Module Definition qmldir Files}{qmldir} file and a typeinfo
174
file will be auto-generated for the QML module being defined. The contents of
175
those files are determined by the various arguments given to this command, as
176
well as the sources and \c{.qml} files added to the backing target.
177
The \l OUTPUT_DIRECTORY argument determines where the \c qmldir and typeinfo
178
files will be written to. If the QML module has a plugin, that plugin will also
179
be created in the same directory as the \c qmldir file.
180
181
If \l{QTP0004} policy is set to \c NEW, for each further directory that contains
182
\c{.qml} files another \c qmldir file is generated. These extra \c qmldir files
183
merely redirect to the module's base directory via a \c prefer directive. This
184
is so that all the QML components in a module can access each other, no matter
185
which directory they are stored in.
186
187
If using a statically built Qt, the backing target's \c{.qml} files will be
188
scanned during the CMake configure run to determine the imports used by the
189
module and to set up linking relationships (the \c{NO_IMPORT_SCAN} keyword
190
can be given to disable this). When a \c{.qml} file is added to or
191
removed from the module, CMake will normally re-run automatically and the
192
relevant files will be re-scanned, since a \c{CMakeLists.txt} file will have
193
been modified. During the course of development, an existing \c{.qml} file may
194
add or remove an import or a type. On its own, this would not cause CMake to
195
re-run automatically, so you should explicitly re-run CMake to force the
196
\c qmldir file to be regenerated and any linking relationships to be updated.
197
198
The backing target's C++ sources are scanned at build time to generate a
199
typeinfo file and a C++ file to register the associated types. The generated
200
C++ file is automatically added to the backing target as a source.
201
This requires \c AUTOMOC to be enabled on the target. The project is
202
responsible for ensuring this, usually by setting the \c CMAKE_AUTOMOC variable
203
to \c TRUE before calling \c qt_add_qml_module(), or by passing in an existing
204
target with the \c AUTOMOC target property already set to \c TRUE. It isn't an
205
error to have \c AUTOMOC disabled on the target, but the project is then
206
responsible for handling the consequences. This may include having to manually
207
generate the typeinfo file instead of allowing it to be auto-generated with
208
missing details, and adding C++ code to register the types.
209
210
Projects should prefer to use the auto-generated typeinfo and \c qmldir files
211
where possible. They are easier to maintain and they don't suffer from the same
212
susceptibility to errors that hand-written files do. Nevertheless, for
213
situations where the project needs to provide these files itself, the
214
auto-generation can be disabled. The \c NO_GENERATE_QMLDIR option disables the
215
\c qmldir auto-generation and the \c NO_GENERATE_QMLTYPES option disables the
216
typeinfo and C++ type registration auto-generation. If the auto-generated
217
typeinfo file is acceptable, but the project wants to use a different name for
218
that file, it can override the default name with the \c TYPEINFO option (but
219
this should not typically be needed).
220
221
\target qmlcachegen-auto
222
\section2 Caching compiled QML sources
223
224
All \c{.qml}, \c{.js}, and \c{.mjs} files added to the module via the
225
\c QML_FILES argument will be compiled to bytecode and cached directly in the
226
backing target. This improves load-time performance of the module. The original
227
uncompiled files are also stored in the backing target's resources, as these
228
may still be needed in certain situations by the QML engine.
229
230
The resource path of each file is determined by its path relative to the
231
current source directory (\c CMAKE_CURRENT_SOURCE_DIR). This resource path is
232
appended to a prefix formed by concatenating the \l{RESOURCE_PREFIX} and
233
the target path (but see \l NO_RESOURCE_TARGET_PATH for an exception to this).
234
235
If \l{QTP0001} policy is set to \c NEW, the \l{RESOURCE_PREFIX} defaults
236
to \c{/qt/qml/} which is the default import path of the QML engine.
237
This ensures that modules are put into the \l{QML Import Path} and can be
238
found without further setup.
239
240
Ordinarily, the project should aim to place \c{.qml} files in
241
the same relative location as they would have in the resources. If the \c{.qml}
242
file is in a different relative directory to its desired resource path, its
243
location in the resources needs to be explicitly specified. This is done by
244
setting the \c QT_RESOURCE_ALIAS source file property, which must be set before
245
the \c{.qml} file is added. For example:
246
247
\badcode
248
set_source_files_properties(path/to/somewhere/MyFrame.qml PROPERTIES
249
QT_RESOURCE_ALIAS MyFrame.qml
250
)
251
252
qt_add_qml_module(someTarget
253
URI MyCo.Frames
254
RESOURCE_PREFIX /my.company.com/imports
255
QML_FILES
256
path/to/somewhere/MyFrame.qml
257
AnotherFrame.qml
258
)
259
\endcode
260
261
In the above example, the target path will be \c{MyCo/Frames}. After
262
taking into account the source file properties, the two \c{.qml} files will be
263
found at the following resource paths:
264
265
\list
266
\li \c{/my.company.com/imports/MyCo/Frames/MyFrame.qml}
267
\li \c{/my.company.com/imports/MyCo/Frames/AnotherFrame.qml}
268
\endlist
269
270
In the rare case that you want to override the automatic selection of the
271
qmlcachegen program to be used, you may set the \c QT_QMLCACHEGEN_EXECUTABLE
272
target property on the module target. For example:
273
274
\badcode
275
set_target_properties(someTarget PROPERTIES
276
QT_QMLCACHEGEN_EXECUTABLE qmlcachegen
277
)
278
\endcode
279
280
This explicitly selects qmlcachegen as the program to be used, even if
281
better alternatives are available.
282
283
Furthermore, you can pass extra arguments to qmlcachegen, by setting the
284
\c QT_QMLCACHEGEN_ARGUMENTS option. In particular, the \c --only-bytecode
285
option will turn off compilation of QML script code to C++. For example:
286
287
\badcode
288
set_target_properties(someTarget PROPERTIES
289
QT_QMLCACHEGEN_ARGUMENTS "--only-bytecode"
290
)
291
\endcode
292
293
Another important argument is \c{--direct-calls}. You can use it to enable the
294
direct mode of \l{The QML script compiler} in case the Qt Quick Compiler
295
Extensions are installed. If the extensions are not installed, the argument is
296
ignored. There is a shorthand called \c {QT_QMLCACHEGEN_DIRECT_CALLS} for it.
297
298
\badcode
299
set_target_properties(someTarget PROPERTIES
300
QT_QMLCACHEGEN_DIRECT_CALLS ON
301
)
302
\endcode
303
304
Finally, the \c --verbose argument can be used to see diagnostic output from
305
qmlcachegen:
306
307
\badcode
308
set_target_properties(someTarget PROPERTIES
309
QT_QMLCACHEGEN_ARGUMENTS "--verbose"
310
)
311
\endcode
312
313
With this flag set, qmlcachegen will output warnings for each function it
314
cannot compile to C++. Some of these warnings will point to problems in your
315
QML code and some will tell you that certain features of the QML language are
316
not implemented in the C++ code generator. In both cases, qmlcachegen will
317
still generate byte code for such functions. If you want to see only the
318
problems in your QML code, you should use qmllint and the targets generated
319
for it instead.
320
321
\target qmllint-auto
322
\section2 Linting QML sources
323
324
A separate linting target will be automatically created if any \c{.qml} files
325
are added to the module via the \c QML_FILES keyword, or by a later call to
326
\l{qt6_target_qml_sources}{qt_target_qml_sources()}. The name of the linting
327
target will be the \c target followed by \c{_qmllint}. An \c{all_qmllint}
328
target which depends on all the individual \c{*_qmllint} targets is also
329
provided as a convenience.
330
331
A \c dump_qml_context_properties global build target is automatically created
332
that runs \l qmlcontextpropertydump when no qml context property dump file
333
already exists. \l qmlcontextpropertydump creates a qml context property dump file
334
that is read by \l qmllint to warn about usages of context properties in QML.
335
336
A \c clean_qml_context_properties global build target allows to delete an already
337
existing qml context property dump file, and can be used to recompute the qml context
338
property dump file on a future build of the \c dump_qml_context_properties global build
339
target.
340
341
Linting targets depend on the \c dump_qml_context_properties build target when
342
the \l QT_QMLLINT_CONTEXT_PROPERTY_DUMP variable is enabled.
343
344
345
\target qml-naming-js-files
346
\section2 Naming conventions for \c{.js} files
347
348
JavaScript file names that are intended to be addressed as components should
349
start with an uppercase letter.
350
351
Alternatively, you may use lowercase file names and set the source file
352
property \l QT_QML_SOURCE_TYPENAME to the desired type name.
353
354
\target qml-cmake-singletons
355
\section2 Singletons
356
357
If a QML module has \c{.qml} files which provide singleton types, these files
358
need to have their \c QT_QML_SINGLETON_TYPE source property set to \c TRUE, to
359
ensure that the \c singleton command is written into the
360
\l{Module Definition qmldir Files}{qmldir} file. This must be done in addition
361
to the QML file containing the \c {pragma Singleton} statement.
362
The source property must be set before creating the module the
363
singleton belongs to.
364
365
See \l{qt_target_qml_sources_example}{qt_target_qml_sources()} for an example on
366
how to set the \c QT_QML_SINGLETON_TYPE property.
367
368
\target qmltc-cmake
369
\section2 Compiling QML to C++ with QML type compiler
370
371
\note The \l{QML type compiler} \c{qmltc} does not guarantee that the generated
372
C++ stays API-, source- or binary-compatible between past or future versions,
373
even patch versions.
374
Furthermore, qmltc-compiled apps using Qt's QML modules will require linking
375
against private Qt API, see also
376
\l{QML type compiler#compiling-qml-code-with-qmltc}{Compiling QML code with qmltc}.
377
378
379
If a QML module has \c{.qml} files, you can compile them to C++ using \l{QML
380
type compiler}{qmltc}. Unlike \l{qmlcachegen-auto}{bytecode compilation}, you
381
have to explicitly enable qmltc via \l{ENABLE_TYPE_COMPILER} argument. In which
382
case, \c{.qml} files specified under \c{QML_FILES} would be compiled. Files
383
ending with \c{.js} and \c{.mjs} are ignored as qmltc does not compile
384
JavaScript code. Additionally, files marked with QT_QML_SKIP_TYPE_COMPILER
385
source file property are also skipped.
386
387
By default, qmltc creates lower-case \c{.h} and \c{.cpp} files for a given
388
\c{.qml} file. For example, \c{Foo.qml} ends up being compiled into \c{foo.h}
389
and \c{foo.cpp}.
390
391
The created C++ files are placed into a dedicated \c{.qmltc/<target>/}
392
sub-directory of the \c BINARY_DIR of the \c target. These files are then
393
automatically added to the target sources and compiled as Qt C++ code along with
394
other source files.
395
396
While processing QML_FILES, the following source file properties are respected:
397
\list
398
\li \c{QT_QMLTC_FILE_BASENAME}: use this source file property to specify a
399
non-default .h and .cpp file name, which might be useful to e.g. resolve
400
conflicting file names (imagine you have main.qml that is being
401
compiled, but main.h already exists, so #include "main.h" might not do
402
what you expect it to do). QT_QMLTC_FILE_BASENAME is expected to be a
403
file name (without extension), so any preceding directory is ignored.
404
Unlike in the case of default behavior, the QT_QMLTC_FILE_BASENAME is
405
not lower-cased.
406
\li \c{QT_QML_SKIP_TYPE_COMPILER}: use this source file property to
407
specify that a QML file must be ignored by qmltc.
408
\endlist
409
410
\section1 Arguments
411
412
The arguments to \c{qt_add_qml_module} are organized into the following
413
categories:
414
415
\table
416
\header
417
\li Category
418
\li Arguments
419
\row
420
\li \l{Essential arguments}
421
\li \c target, \c URI, \c STATIC, \c SHARED
422
\row
423
\li \l{Versions}
424
\li \c VERSION, \l{PAST_MAJOR_VERSIONS},
425
\l{Keeping module versions in sync}{FOLLOW_FOREIGN_VERSIONING}
426
\row
427
\li \l{Adding sources and resources to the module}{Sources and resources}
428
\li \c QML_FILES, \c SOURCES, \c RESOURCES, \l{RESOURCE_PREFIX}, \l{NO_RESOURCE_TARGET_PATH},
429
\l{DISCARD_QML_CONTENTS}
430
\row
431
\li \l{Declaring module dependencies}{Module dependencies}
432
\li \l{IMPORTS}, \c OPTIONAL_IMPORTS, \c DEFAULT_IMPORTS, \c DEPENDENCIES,
433
\l{IMPORT_PATH}
434
\row
435
\li \l{Targets and plugin targets}{Plugin configuration}
436
\li \l{PLUGIN_TARGET}, \l{NO_PLUGIN}, \l{NO_PLUGIN_OPTIONAL},
437
\l{NO_CREATE_PLUGIN_TARGET}, \l{NO_GENERATE_PLUGIN_SOURCE},
438
\l{CLASS_NAME}
439
\row
440
\li \l{Automatic type registration}{Code generation and tooling}
441
\li \c NO_GENERATE_QMLTYPES, \c NO_GENERATE_QMLDIR, \c NO_GENERATE_EXTRA_QMLDIRS,
442
\c TYPEINFO, \c NO_CACHEGEN, \c NO_LINT,
443
\l{qmlimportscanner and NO_IMPORT_SCAN}{NO_IMPORT_SCAN},
444
\c{NO_GENERATE_AOT_VALIDATION}
445
\row
446
\li \l{OUTPUT_DIRECTORY}{Output and installation}
447
\li \l{OUTPUT_DIRECTORY}, \c OUTPUT_TARGETS, \l{NO_GENERATE_QTCONF}
448
\row
449
\li \l{C++ namespaces of generated code}{Other}
450
\li \c NAMESPACE, \c DESIGNER_SUPPORTED
451
\row
452
\li \l{Arguments for qmltc}{QML type compiler (qmltc)}
453
\li \l{ENABLE_TYPE_COMPILER}, \c TYPE_COMPILER_NAMESPACE,
454
\c QMLTC_EXPORT_DIRECTIVE, \c QMLTC_EXPORT_FILE_NAME
455
\endtable
456
457
\section2 Essential arguments
458
459
The \c target specifies the name of the backing target for the QML module.
460
By default, it is created as a shared library if Qt was built as shared
461
libraries, or as a static library otherwise. This choice can be explicitly
462
overridden with the \c STATIC or \c SHARED options.
463
464
Every QML module must define a \c URI. It should be specified in dotted URI
465
notation, such as \c{QtQuick.Layouts}. Each segment must be a well-formed
466
ECMAScript Identifier Name. This means, for example, the segments
467
must not start with a number and they must not contain \e{-} (minus)
468
characters. As the \c URI will be translated into directory names, you
469
should restrict it to alphanumeric characters of the latin alphabet,
470
underscores, and dots. Other QML modules may use this name in
471
\l{qtqml-syntax-imports.html}{import statements} to import the module. The
472
\c URI will be used in the \c module line of the generated
473
\l{Module Definition qmldir Files}{qmldir} file. The \c URI is also used to
474
form the \e{target path} by replacing dots with forward slashes.
475
476
See \l{qtqml-modules-identifiedmodules.html}{Identified Modules} for further
477
in-depth discussion of the module URI.
478
479
\section2 Versions
480
481
A QML module can also define a \c VERSION in the form \c{Major.Minor}, where
482
both \c Major and \c Minor must be integers. An additional \c{.Patch}
483
component may be appended, but will be ignored. A list of earlier major
484
versions the module provides types for can also optionally be given after the
485
\c PAST_MAJOR_VERSIONS keyword (see below).
486
See \l{qtqml-modules-identifiedmodules.html}{Identified Modules} for further
487
in-depth discussion of version numbering,
488
\l{Registering past major versions} for registering past major versions, and
489
\l{Keeping module versions in sync} for keeping module versions in sync.
490
491
If you don't need versions you should omit the \c VERSION argument. It defaults
492
to the highest possible version. Internal versioning of QML modules has some
493
fundamental flaws. You should use an external package management mechanism to
494
manage different versions of your QML modules.
495
496
\section2 Adding sources and resources to the module
497
498
\note A QML module is a logically grouped, self-contained unit of functionality.
499
All files that make up the module should reside in the same directory as the CMakeLists.txt
500
defining the module or in one of its subdirectories.
501
If a specific functionality is required in multiple modules, consider encapsulating it within
502
a separate module. This module can then be imported into other modules, promoting code reuse
503
and maintainability.
504
505
\c SOURCES specifies a list of non-QML sources to be added to the backing
506
target. It is provided as a convenience and is equivalent to adding the sources
507
to the backing target with the built-in \c{target_sources()} CMake command.
508
509
\c QML_FILES lists the \c{.qml}, \c{.js} and \c{.mjs} files for the module.
510
These will be automatically \l{qmlcachegen-auto}{compiled into bytecode} and
511
embedded in the backing target unless the \c NO_CACHEGEN option is given.
512
The uncompiled file is always stored in the embedded resources of the backing
513
target, even if \c NO_CACHEGEN is specified. Unless the \c NO_LINT option is
514
given, the uncompiled files will also be
515
\l{Linting QML sources}{processed by \c qmllint} via a separate custom build
516
target. The files will also be used to populate type information in the
517
generated \l{Module Definition qmldir Files}{qmldir} file by default.
518
\c NO_GENERATE_QMLDIR can be given to disable the automatic generation of the
519
\c qmldir file. This should normally be avoided, but for cases where the
520
project needs to provide its own \c qmldir file, this option can be used.
521
Since Qt 6.8, when \l{QTP0004} is enabled, \c qt_add_qml_module will
522
create additional \c qmldir files for each subdirectory in the QML module,
523
which ensure that each QML file will import its own module via the implicit
524
import. This behavior can be turned off for a QML module by passing the
525
\c NO_GENERATE_EXTRA_QMLDIRS flag to it.
526
The \c NO_GENERATE_QMLDIR implies \c NO_GENERATE_EXTRA_QMLDIRS.
527
528
\note See \l{qt6_target_qml_sources}{qt_target_qml_sources()} for further details on
529
how to add qmlfiles after \c qt_add_qml_module() was called.
530
For example, you may wish to add files conditionally based on an if statement
531
expression, or from subdirectories that will only be added if certain criteria
532
are met.
533
Furthermore, files added with \l{qt6_target_qml_sources}{qt_target_qml_sources()}
534
also can specify if they should be skipped for the linting,
535
\l{qmlcachegen-auto}{bytecode compilation} or \c qmldir file generation.
536
537
\c RESOURCES lists any other files needed by the module, such as images
538
referenced from the QML code. These files will be added as compiled-in
539
resources (see \l RESOURCE_PREFIX for an explanation of the base point they
540
will be located under). If needed, their relative location can
541
be controlled by setting the \c QT_RESOURCE_ALIAS source property, just as for
542
\c{.qml} files (see \l{qmlcachegen-auto}{Caching compiled QML sources}).
543
544
\target RESOURCE_PREFIX
545
\c RESOURCE_PREFIX is intended to encapsulate a namespace for the project and
546
will often be the same for all QML modules that the project defines.
547
548
However, it is better to set the \l QTP0001 CMake policy instead. It defines a
549
default resource prefix that ensures that your QML module ends
550
up under one of the QML engine's default \l[QtQml]{QML Import Path}{import paths}.
551
552
If you set a \c RESOURCE_PREFIX, you should also add it to the
553
\l[QtQml]{QML Import Path}{import paths} for the QML Engine to find the QML module.
554
555
If \l QTP0001 is enabled (e.g. via
556
\c {qt_standard_project_setup(REQUIRES 6.5)}), the default value is
557
\c "/qt/qml/", otherwise it is \c {"/"}.
558
559
\target NO_RESOURCE_TARGET_PATH
560
When various files are added to the compiled-in resources, they are placed
561
under a path formed by concatenating the \c RESOURCE_PREFIX and the target path.
562
For the special case where the backing target is an executable, it may be
563
desirable to place the module's \c{.qml} files and other resources directly
564
under the \c RESOURCE_PREFIX instead. This can be achieved by specifying the
565
\c NO_RESOURCE_TARGET_PATH option, which may only be used if the backing target
566
is an executable.
567
568
\note The resource path, the \l{OUTPUT_DIRECTORY}{output directory} on disk,
569
and the \l{IMPORT_PATH}{import path} are all related. When changing any of
570
these, ensure the others are consistent so that the QML engine and tooling can
571
find the module. See \l{Custom Directory Layouts} in \l{Writing QML Modules} for
572
a complete explanation.
573
574
\target PAST_MAJOR_VERSIONS
575
\section2 Registering past major versions
576
577
\c PAST_MAJOR_VERSIONS contains a list of additional major version that the module
578
provides. For each of those versions and each QML file
579
without a \c QT_QML_SOURCE_VERSIONS setting an additional entry in the
580
\l{Module Definition qmldir Files}{qmldir} file will be generated to specify
581
the extra version. Furthermore, the generated module registration code will
582
register the past major versions using \l{qmlRegisterModule()} on the C++ side.
583
The module registration code is automatically generated for your QML module,
584
unless you specify \c{NO_GENERATE_QMLTYPES} (but use of this option is strongly
585
discouraged). Usage of \c PAST_MAJOR_VERSIONS adds some overhead when your
586
module is imported. You should increment the major version of your module as
587
rarely as possible. Once you can rely on all QML files importing this module to
588
omit the version in their imports, you can safely omit \c{PAST_MAJOR_VERSIONS}.
589
All the QML files will then import the latest version of your module. If you
590
have to support versioned imports, consider supporting only a limited number of
591
past major versions.
592
593
\section2 Declaring module dependencies
594
595
\target IMPORTS
596
\c IMPORTS provides a list of other QML modules that this module imports. Each
597
module listed here will be added as an \c{import} entry in the generated
598
\l{Module Definition qmldir Files}{qmldir} file. If a QML file imports
599
this module, it also imports all the modules listed under \c{IMPORTS}.
600
Optionally, a version can be specified by appending it after a slash, such as
601
\c{QtQuick/2.0}. Omitting the version will cause the greatest version available
602
to be imported. You may only specify the major version, as in \c{QtQuick/2}. In
603
that case the greatest minor version available with the given major version will
604
be imported. Finally, \c{auto} may be given as version (\c{QtQuick/auto}). If
605
\c{auto} is given, the version that the current module is being imported with is
606
propagated to the module to be imported. Given an entry \c{QtQuick/auto} in a
607
module \c{YourModule}, if a QML file specifies \c{import YourModule 3.14}, this
608
results in importing version \c{3.14} of \c{QtQuick}. For related modules that
609
follow a common versioning scheme, you should use \c{auto}.
610
611
Entries in \c IMPORTS may also refer to CMake targets by prefixing the target
612
name with the \c TARGET keyword. In this case, the QML module URI is determined
613
automatically from the target. This requires opting into the CMake policy
614
\l{QTP0005}.
615
616
For example, a QML module can import another module by referring to the
617
CMake target that provides it:
618
619
\badcode
620
qt_add_qml_module(my_module
621
URI MyModule
622
VERSION 1.0
623
IMPORTS
624
TARGET OtherQmlModule
625
)
626
\endcode
627
628
\c OPTIONAL_IMPORTS provides a list of other QML modules that this module
629
\e may import at run-time. These are not automatically imported by the QML
630
engine when importing the current module, but rather serve as hints to tools
631
like \c qmllint. Versions can be specified in the same way as for \c IMPORTS.
632
Each module listed here will be added as an \c{optional import} entry in the
633
generated \l{Module Definition qmldir Files}{qmldir} file.
634
635
Entries in \c OPTIONAL_IMPORTS may also refer to CMake targets by prefixing the
636
target name with the \c TARGET keyword. In this case, the QML module URI is
637
determined automatically from the target. This requires opting into the CMake
638
policy \l{QTP0005}.
639
640
For example:
641
642
\badcode
643
qt_add_qml_module(my_module
644
URI MyModule
645
VERSION 1.0
646
OPTIONAL_IMPORTS
647
TARGET OptionalQmlModule
648
)
649
\endcode
650
651
\c DEFAULT_IMPORTS specifies which of the optional imports are the default entries
652
that should be loaded by tooling. One entry should be specified for every group of
653
\c OPTIONAL_IMPORTS in the module. As optional imports are only resolved at runtime,
654
tooling like qmllint cannot in general know which of the optional imports should
655
be resolved. To remedy this, you can specify one of the optional imports as the
656
default import; tooling will then pick it. If you have one optional import that
657
gets used at runtime without any further configuration, that is an ideal candidate
658
for the default import.
659
660
Entries in \c DEFAULT_IMPORTS may also refer to CMake targets by prefixing the
661
target name with the \c TARGET keyword. In this case, the QML module URI is
662
determined automatically from the target. This requires opting into the CMake
663
policy \l{QTP0005}.
664
665
For example:
666
667
\badcode
668
qt_add_qml_module(my_module
669
URI MyModule
670
VERSION 1.0
671
OPTIONAL_IMPORTS
672
TARGET BackendA
673
TARGET BackendB
674
DEFAULT_IMPORTS
675
TARGET BackendA
676
)
677
\endcode
678
679
\c DEPENDENCIES provides a list of other QML modules that this module depends
680
on, but doesn't necessarily import. It would typically be used for dependencies
681
that only exist at the C++ level, such as a module registering a class to QML
682
which uses or inherits C++ defined types defined in another module.
683
684
For example, if one would like to subclass \c QQuickItem as following:
685
686
\badcode
687
class MyItem: public QQuickItem { ... };
688
\endcode
689
690
then one has to make sure that the module containing \c QQuickItem, called
691
\c QtQuick, is declared as a dependency via the \c DEPENDENCIES option:
692
693
\badcode
694
qt_add_qml_module(myTarget
695
...
696
DEPENDENCIES QtQuick
697
)
698
\endcode
699
700
Not doing so might result in linting errors, errors during type compilation
701
with \l{QML type compiler}{qmltc} or during binding and function compilation to C++
702
with \l{qmlcachegen-auto}{qmlcachegen}.
703
704
Another example might be:
705
\code
706
class MyComponent : public QObject {
707
Q_OBJECT
708
QML_ELEMENT
709
710
// ...
711
712
signals:
713
void sigZoomAtMousePosition(const QPointF& aMousePos, double aZoomScaleFactor);
714
};
715
\endcode
716
where \c{DEPENDENCIES QtQml} is required for QML tooling to find and use QPointF:
717
\badcode
718
qt_add_qml_module(myTarget
719
...
720
DEPENDENCIES QtQml
721
)
722
\endcode
723
724
Entries in \c DEPENDENCIES may also refer to CMake targets by prefixing the
725
target name with the \c TARGET keyword. In this case, the QML module URI and
726
import path are determined automatically from the target. This requires
727
opting into the CMake policy \l{QTP0005}.
728
729
For example, a QML module can declare a dependency on another module by
730
referring to the CMake target that provides it:
731
732
\badcode
733
qt_add_qml_module(my_module
734
URI MyModule
735
VERSION 1.0
736
DEPENDENCIES
737
TARGET OtherQmlModule
738
)
739
\endcode
740
741
\note Using \c{TARGET <cmake-target>} in \c DEPENDENCIES, \c IMPORTS,
742
\c OPTIONAL_IMPORTS, or \c DEFAULT_IMPORTS does not automatically link against
743
the given target. It is used only to derive QML metadata, import paths, and to
744
establish build-order dependencies. If the QML module or its generated plugin
745
requires symbols from that target, the target must still be linked explicitly
746
using \c target_link_libraries().
747
748
\note The \c{<cmake-target>} used with the \c TARGET keyword must be a target
749
built by your project (not an imported target provided by \c{find_package}).
750
751
\note When using \c{TARGET <cmake-target>} in \c DEPENDENCIES, \c IMPORTS,
752
\c OPTIONAL_IMPORTS, or \c DEFAULT_IMPORTS, only the direct dependency on the
753
specified target is established. Transitive QML module dependencies of the
754
referenced target (that is, QML modules which that target itself depends on)
755
are \e not automatically added. Each QML module dependency must be declared
756
explicitly.
757
758
\note Adding the module to \c DEPENDENCIES is not necessary if the module
759
is already imported via the \c IMPORTS option. The recommended way is to
760
use the lighter alternative \c DEPENDENCIES over \c IMPORTS.
761
762
\target NO_GENERATE_QTCONF
763
When the backing target is an executable and \c{TARGET} dependencies are used
764
(requires \l{QTP0005}), \c{qt_add_qml_module()} automatically generates a
765
\c{qt.conf} file next to the executable in the build tree. This file configures
766
the \l{QML Import Path} so that the QML engine can locate the module's
767
dependencies at run time without requiring manual \c IMPORT_PATH entries. The
768
\c NO_GENERATE_QTCONF option suppresses this behavior, which may be necessary
769
if the generated file conflicts with a \c qt.conf already present in the build
770
directory. This option was introduced in Qt 6.12.
771
772
\warning When using \c NO_GENERATE_QTCONF, the application may fail to find its
773
QML module dependencies at run time. You must manually configure the
774
\l{QML Import Path} — for example, by adding the appropriate import paths to
775
the existing \c qt.conf file.
776
777
The module version of the
778
dependencies must be specified along with the module name, in the same form as
779
used for \c IMPORTS and \c OPTIONAL_IMPORTS. Each module listed here will be
780
added as a \c{depends} entry in the generated
781
\l{Module Definition qmldir Files}{qmldir} file.
782
783
\target IMPORT_PATH
784
\c IMPORT_PATH can be used to add to the search paths where other QML modules
785
that this one depends on can be found. The other modules must have their
786
\c qmldir file under their own target path below one of the search paths.
787
788
If the backing target is a static library and that static library will be
789
installed, \c OUTPUT_TARGETS should be given to provide a variable in which to
790
store a list of additional targets that will also need to be installed.
791
These additional targets are generated internally by \c{qt_add_qml_module()}
792
and are referenced by the backing target's linking requirements as part of
793
ensuring that resources are set up and loaded correctly.
794
795
\target PLUGIN_TARGET
796
\section2 Targets and plugin targets
797
798
The following options control how the plugin target is created and configured.
799
For most modules, the defaults are appropriate and none of these options are
800
needed. Common scenarios:
801
802
\list
803
\li \b{Default} — a separate plugin target is created automatically with a
804
generated source file. The plugin is optional (not loaded when the backing
805
library is linked directly).
806
\li \b{Custom plugin} — use \l{NO_GENERATE_PLUGIN_SOURCE} to provide your own
807
plugin class implementation. You should also set \l{CLASS_NAME} to match
808
your custom plugin class. Typically also requires
809
\l{NO_PLUGIN_OPTIONAL} since the plugin then contains non-trivial code.
810
\li \b{No plugin} — use \l{NO_PLUGIN} when the module is always linked
811
directly and never loaded dynamically.
812
\li \b{Executable target} — no plugin is created automatically.
813
\endlist
814
815
\c PLUGIN_TARGET specifies the plugin target associated with the QML module.
816
The \c PLUGIN_TARGET can be the same as the backing
817
\c target, in which case there will be no separate backing target.
818
If \c PLUGIN_TARGET is not given, it defaults to \c target with \c plugin
819
appended. For example, a backing target called \c mymodule would have a default
820
plugin name of \c mymoduleplugin. The plugin target's name will be used to
821
populate a \c{plugin} line in the generated
822
\l{Module Definition qmldir Files}{qmldir} file. Therefore, you must not try to
823
change the plugin's output name by setting target properties like
824
\c OUTPUT_NAME or any of its related properties.
825
826
The backing \c target and the plugin target (if different) will be created by
827
the command, unless they already exist. Projects should generally let them be
828
created by the command so that they are created as the appropriate target type.
829
If the backing \c target is a static library, the plugin will also be created
830
as a static library. If the backing \c target is a shared library, the plugin
831
will be created as a module library. If an existing \c target is passed in and
832
it is an executable target, there will be no plugin. If you intend to always
833
link directly to the backing target and do not need a plugin, it can be
834
disabled by adding the \c NO_PLUGIN option. Specifying both \c NO_PLUGIN and
835
\c PLUGIN_TARGET is an error.
836
837
\target NO_CREATE_PLUGIN_TARGET
838
In certain situations, the project may want to delay creating the plugin target
839
until after the call. The \c NO_CREATE_PLUGIN_TARGET option can be given in
840
that situation. The project is then expected to call
841
\l{qt6_add_qml_plugin}{qt_add_qml_plugin()} on the plugin target once it has
842
been created. When \c NO_CREATE_PLUGIN_TARGET is given, \c PLUGIN_TARGET must
843
also be provided to explicitly name the plugin target.
844
845
\target CLASS_NAME
846
\target NO_GENERATE_PLUGIN_SOURCE
847
By default, \c{qt_add_qml_module()} will auto-generate a \c{.cpp} file that
848
implements the plugin class named by the \c CLASS_NAME argument. The generated
849
\c{.cpp} file will be automatically added to the plugin target as a source file
850
to be compiled. If the project wants to provide its own implementation of the
851
plugin class, the \c NO_GENERATE_PLUGIN_SOURCE option should be given. Where no
852
\c CLASS_NAME is provided, it defaults to the \c URI with dots replaced by
853
underscores, then \c Plugin appended. Unless the QML module has no plugin, the
854
class name will be recorded as a \c classname line in the generated
855
\l{Module Definition qmldir Files}{qmldir} file. You need to add any C++ files
856
with custom plugin code to the plugin target. Since the plugin then likely
857
contains functionality that goes beyond simply loading the backing library, you
858
will probably want to add \l{NO_PLUGIN_OPTIONAL}, too. Otherwise the QML engine
859
may skip loading the plugin if it detects that the backing library is already
860
linked.
861
862
\target NO_PLUGIN
863
If the \c NO_PLUGIN keyword is given, then no plugin will be built. This
864
keyword is thus incompatible with all the options that customize the plugin
865
target, in particular \l{NO_GENERATE_PLUGIN_SOURCE}, \l{NO_PLUGIN_OPTIONAL},
866
\l{PLUGIN_TARGET}, \l{NO_CREATE_PLUGIN_TARGET}, and \l{CLASS_NAME}. If you do
867
not provide a plugin for your module, it will only be fully usable if its
868
backing library has been linked into the executable. It is generally hard to
869
guarantee that a linker preserves the linkage to a library it considers unused.
870
871
\target NO_PLUGIN_OPTIONAL
872
If the \c NO_PLUGIN_OPTIONAL keyword is given, then the plugin is recorded in
873
the generated \c qmldir file as non-optional. If all of a QML module's
874
functionality is implemented in its backing target and the plugin target is
875
separate, then the plugin can be optional, which is the default and recommended
876
arrangement. The auto-generated plugin source file satisfies this requirement.
877
Where a project provides its own \c{.cpp} implementation for the plugin, that
878
would normally mean the \c NO_PLUGIN_OPTIONAL keyword is also needed because
879
the plugin will almost certainly contain functionality that the QML module
880
requires.
881
882
\section2 Automatic type registration
883
884
\c{qt_add_qml_module} automatically generates several files. The following
885
options control what is generated. In most cases, the defaults are correct and
886
none of these options are needed.
887
888
\table
889
\header
890
\li Option
891
\li What it disables
892
\row
893
\li \c NO_GENERATE_QMLTYPES
894
\li Typeinfo file (\c{.qmltypes}) and C++ type registration code
895
\row
896
\li \c NO_GENERATE_QMLDIR
897
\li The \c qmldir module definition file (implies \c NO_GENERATE_EXTRA_QMLDIRS)
898
\row
899
\li \c NO_GENERATE_EXTRA_QMLDIRS
900
\li Additional \c qmldir files for subdirectories (see \l{QTP0004})
901
\row
902
\li \c NO_CACHEGEN
903
\li Bytecode compilation of \c{.qml}, \c{.js}, and \c{.mjs} files
904
\row
905
\li \c NO_LINT
906
\li The \c{*_qmllint} linting target
907
\row
908
\li \l{qmlimportscanner and NO_IMPORT_SCAN}{NO_IMPORT_SCAN}
909
\li Automatic import scanning (static builds: configure-time; executables: build-time)
910
\row
911
\li \c NO_GENERATE_AOT_VALIDATION
912
\li Generation of code to \l{Validation of ahead of time generated native code}{validate native code}
913
generated ahead of time by the \l{Qt Quick Compiler}
914
\endtable
915
916
Type registration is automatically performed for the backing target's C++
917
sources that are processed by \c{AUTOMOC}. This will generate a typeinfo file in
918
the \l{OUTPUT_DIRECTORY}{output directory}, the file name being the \c target
919
name with \c{.qmltypes} appended. This file name can be changed using the
920
\c TYPEINFO option if desired, but this should not normally be necessary.
921
The file name is also recorded as a \c typeinfo entry in the generated
922
\l{Module Definition qmldir Files}{qmldir} file. Automatic type registration
923
can be disabled using the \c NO_GENERATE_QMLTYPES option, in which case no
924
typeinfo file will be generated, but the project will still be expected to
925
generate a typeinfo file and place it in the same directory as the generated
926
\c qmldir file.
927
928
\target OUTPUT_DIRECTORY
929
\c OUTPUT_DIRECTORY specifies where the plugin library, \c qmldir and typeinfo
930
files are generated. When this keyword is not given, the default value will be
931
the target path (formed from the \c URI) appended to the value of the
932
\l QT_QML_OUTPUT_DIRECTORY variable.
933
If that variable is not defined, the default depends on the type of backing
934
target. For executables, the value will be the target path appended to
935
\c{${CMAKE_CURRENT_BINARY_DIR}}, whereas for other targets it will be just
936
\c{${CMAKE_CURRENT_BINARY_DIR}}. When the structure of the source tree
937
matches the structure of QML module target paths (which is highly recommended),
938
\l QT_QML_OUTPUT_DIRECTORY often isn't needed. In order to match the structure
939
of the target paths, you have to call your directories \e exactly like the
940
segments of your module URI. For example, if your module URI is
941
\c{MyUpperCaseThing.mylowercasething}, you need to put this in a directory
942
called \c{MyUpperCaseThing/mylowercasething/}.
943
944
The need for specifying the \c OUTPUT_DIRECTORY keyword should be rare, but if
945
it is used, it is likely that the caller will also need to add to the
946
\l IMPORT_PATH to ensure that \l{qmllint-auto}{linting},
947
\l{qmlcachegen-auto}{cached compilation} of qml sources,
948
\l{qt6_import_qml_plugins}{automatic importing} of plugins in static builds,
949
and \l{qt_deploy_qml_imports}{deploying imported QML modules} for non-static
950
builds all work correctly.
951
952
\section2 Qt Quick Designer compatibility
953
954
\c DESIGNER_SUPPORTED should be given if the QML module supports
955
Qt Quick Designer. When present, the generated \c qmldir file will contain
956
a \c designersupported line. See \l{Module Definition qmldir Files} for how
957
this affects the way Qt Quick Designer handles the plugin.
958
959
\section2 Keeping module versions in sync
960
961
The \c FOLLOW_FOREIGN_VERSIONING keyword relates to base types of your own
962
C++-defined QML types that live in different QML modules. Typically, the
963
versioning scheme of your module does not match that of the module providing
964
the base types. Therefore, by default all revisions of the base types are
965
made available in any import of your module. If \c FOLLOW_FOREIGN_VERSIONING
966
is given, the version information attached to the base types and their
967
properties is respected. So, an \c {import MyModule 2.8} will then only make
968
available versioned properties up to version \c{2.8} of any base types outside
969
\c{MyModule}.
970
This is mostly useful if you want to keep your module version in sync
971
with other modules you're basing types on. In that case you might want your custom
972
types to not expose properties from a module's base type version greater than the one being
973
imported.
974
975
\section2 C++ namespaces of generated code
976
977
If a namespace is given with the \c NAMESPACE keyword, the plugin and registration
978
code will be generated into a C++ namespace of this name.
979
980
\section2 qmlimportscanner and NO_IMPORT_SCAN
981
982
For static Qt builds, \c{qmlimportscanner} is run at configure time to scan the
983
\c{.qml} files of a QML module and identify the QML imports it uses (see
984
\l{qt6_import_qml_plugins}{qt_import_qml_plugins()}). For non-static Qt builds,
985
if the target is an executable, a similar scan is performed at build time to
986
provide the information needed by deployment scripts (see
987
\l{qt6_deploy_qml_imports}{qt_deploy_qml_imports()}). Both scans can be
988
disabled by providing the \c{NO_IMPORT_SCAN} option. Doing so means the project
989
takes on the responsibility of ensuring all required plugins are instantiated
990
and linked for static builds. For non-static builds the project must manually
991
work out and deploy all QML modules used by an executable target.
992
993
\section2 DISCARD_QML_CONTENTS
994
995
\target DISCARD_QML_CONTENTS
996
By default, QML and JS source file contents are included in the target's resource system.
997
Use \c DISCARD_QML_CONTENTS to remove these contents and reduce the binary size.
998
999
\note If you omit the source code from the binary, the QML engine has to
1000
rely on the compilation units created by \l{qmlcachegen} or \l{qmlsc}.
1001
Those are tied to the specific version of Qt they were built with. If you change
1002
the version of Qt your application uses, they can't be loaded anymore.
1003
1004
\section2 Arguments for qmltc
1005
1006
\target ENABLE_TYPE_COMPILER
1007
\c ENABLE_TYPE_COMPILER can be used to compile \c{.qml} files to C++ source code
1008
with \l{QML type compiler}{qmltc}. Files with the source property
1009
\c{QT_QML_SKIP_TYPE_COMPILER} are not compiled to C++.
1010
1011
\c TYPE_COMPILER_NAMESPACE argument allows to override the namespace in which
1012
\l{QML type compiler}{qmltc} generates code.
1013
By default, the namespace of the generated code follows the module
1014
hierarchy as depicted in the URI,
1015
e.g., \c MyModule for a module with URI \c MyModule or
1016
\c com::example::Module for URI \c com.example.MyModule.
1017
By specifying the \c TYPE_COMPILER_NAMESPACE option, the generated code
1018
can be put instead in a custom namespace, where different subnamespaces are to
1019
be separated by a "::", e.g. "MyNamespace::MySubnamespace" for the namespace MySubnamespace that
1020
is inside the MyNamespace. Apart from the "::", C++ namespace naming rules
1021
apply.
1022
1023
\c QMLTC_QMLTC_EXPORT_DIRECTIVE should be used with \c QMLTC_EXPORT_FILE_NAME when
1024
the classes generated by \l{QML type compiler}{qmltc} should be exported from
1025
the qml library. By default, classes generated by qmltc are not exported from
1026
their library.
1027
The header defining the export macro for the current library
1028
can be specified as an optional argument to \c QMLTC_EXPORT_FILE_NAME while the
1029
exporting macro name should be specified as an argument to
1030
\c QMLTC_QMLTC_EXPORT_DIRECTIVE. If no additional include is required or wanted,
1031
e.g. when the header of the export macro is already indirectly included by a base
1032
class, then the \c QMLTC_EXPORT_FILE_NAME option can be left out.
1033
*/
qtdeclarative
src
qml
doc
src
cmake
qt_add_qml_module.qdoc
Generated on
for Qt by
1.16.1