Qt6 QML 中的 CMake 源文件属性

CMake 命令支持以下 CMake 源文件属性:

另请参阅 《CMake 属性参考》。

QT_QMLTC_FILE_BASENAME

指定非默认的 .h 和 .cpp 文件名。

QT_QML_GENERATE_ANDROID_JAVA_CLASS

将 QML 文件标记为用于生成 Java 代码。

QT_QML_INTERNAL_TYPE

将 QML 文件标记为提供内部类型。

QT_QML_SINGLETON_TYPE

将 QML 文件标记为提供单例类型。

QT_QML_SKIP_CACHEGEN

将文件排除在编译为字节码之外。

QT_QML_SKIP_QMLDIR_ENTRY

将文件排除在 QML 模块的 typeinfo 文件中作为类型添加的范围之外。

QT_QML_SKIP_QMLLINT

防止文件被纳入自动 qmllint 处理。

QT_QML_SKIP_TYPE_COMPILER

将文件排除在使用 qmltc 编译为 C++ 的范围之外。

QT_QML_SOURCE_TYPENAME

覆盖文件提供的类型名称。

QT_QML_SOURCE_VERSIONS

为一个类型指定一组自定义版本。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.