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
[OPTIMIZE_PATHS]
28
[OUTLINE_STROKE_MODE]
29
[TYPE_NAME "MyShapeName"]
30
[COPYRIGHT_STATEMENT "Copyright © Company1"]
31
FILES file1.svg [file2.svg ...]
32
OUTPUTS File1.qml [File2.qml ...]
33
)
34
\endcode
35
36
\versionlessCMakeCommandsNote qt6_target_qml_from_svg()
37
38
Example:
39
40
\snippet vectorimage/CMakeLists.txt svgtoqml
41
42
\section1 Description
43
44
qt_target_qml_from_svg() creates the build steps to run \l{svgtoqml} on the list of SVG images in
45
\c FILES. The names of the generated files should be specified in \c OUTPUTS. The length of this
46
list must be the same as \c FILES, and the first element corresponds to the first element in
47
\c FILES and so forth. The names provided in \c OUTPUTS will be the names of the QML types as they
48
appear in the module. These can in turn be instantiated in the application code.
49
50
The generated QML files will be added to the QML module of \c{target}. You must use
51
\l{qt_add_qml_module()} to define a module for the \c{target} first.
52
53
Optionally, a \c COPYRIGHT_STATEMENT argument can be provided to insert copyright information
54
into the generated files.
55
56
\note Certain characters must be escaped for command line use or you may see build errors on
57
some platforms.
58
59
\c TYPE_NAME is also optional, and can be used to replace all instances of the \l{Shape} type in
60
the generated file with a custom type. This can be useful to make general customizations to all
61
the shapes in the provided SVG files. The \c{TYPE_NAME} should refer to a QML type which is
62
available in the \c{target} QML module.
63
64
The options \c CURVE_RENDERER, \c OPTIMIZE_PATHS and \c OUTLINE_STROKE_MODE correspond to the
65
\c{--curve-renderer}, \c{--optimize-paths} and \c{--outline-stroke-mode} in \l{svgtoqml}
66
respectively.
67
*/
qtdeclarative
src
quick
doc
src
cmake
qt_target_qml_from_svg.qdoc
Generated on
for Qt by
1.14.0