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_target_qml_from_svg.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2025 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt_target_qml_from_svg.html
6
\ingroup cmake-commands-qtquick
7
8
\title qt_target_qml_from_svg
9
\keyword qt6_target_qml_from_svg
10
11
\summary {Generates QML code based on an SVG file.}
12
13
The command is defined in the \c QuickTools component of the \c Qt6 package, which can
14
be loaded like this:
15
16
\badcode
17
find_package(Qt6 REQUIRED COMPONENTS QuickTools)
18
\endcode
19
20
\cmakecommandsince 6.11
21
22
\section1 Synopsis
23
24
\badcode
25
qt_target_qml_from_svg(target
26
[CURVE_RENDERER]
27
[ASYNCHRONOUS_SHAPES]
28
[OPTIMIZE_PATHS]
29
[OUTLINE_STROKE_MODE]
30
[TYPE_NAME "MyShapeName"]
31
[COPYRIGHT_STATEMENT "Copyright © Company1"]
32
FILES file1.svg [file2.svg ...]
33
OUTPUTS File1.qml [File2.qml ...]
34
)
35
\endcode
36
37
\versionlessCMakeCommandsNote qt6_target_qml_from_svg()
38
39
Example:
40
41
\snippet vectorimage/CMakeLists.txt svgtoqml
42
43
\section1 Description
44
45
qt_target_qml_from_svg() creates the build steps to run \l{svgtoqml} on the list of SVG images in
46
\c FILES. The names of the generated files should be specified in \c OUTPUTS. The length of this
47
list must be the same as \c FILES, and the first element corresponds to the first element in
48
\c FILES and so forth. The names provided in \c OUTPUTS will be the names of the QML types as they
49
appear in the module. These can in turn be instantiated in the application code.
50
51
The generated QML files will be added to the QML module of \c{target}. You must use
52
\l{qt_add_qml_module} to define a module for the \c{target} first.
53
54
Optionally, a \c COPYRIGHT_STATEMENT argument can be provided to insert copyright information
55
into the generated files.
56
57
\note Certain characters must be escaped for command line use or you may see build errors on
58
some platforms.
59
60
\c TYPE_NAME is also optional, and can be used to replace all instances of the \l{Shape} type in
61
the generated file with a custom type. This can be useful to make general customizations to all
62
the shapes in the provided SVG files. The \c{TYPE_NAME} should refer to a QML type which is
63
available in the \c{target} QML module.
64
65
The options \c CURVE_RENDERER, \c ASYNCHRONOUS_SHAPES, \c OPTIMIZE_PATHS and \c OUTLINE_STROKE_MODE
66
correspond to the \c{--curve-renderer}, \c{--asynchronous-shapes}, \c{--optimize-paths} and
67
\c{--outline-stroke-mode} in \l{svgtoqml} respectively.
68
*/
qtdeclarative
src
quick
doc
src
cmake
qt_target_qml_from_svg.qdoc
Generated on
for Qt by
1.16.1