qmlcontextpropertydump

qmlcontextpropertydump会扫描 C++ 源代码文件夹,查找潜在的上下文属性定义,并将其以qmllint和 QML Language Server。

建议通过CMake API 使用qmlcontextpropertydump:qt_add_qml_module会创建一个全局目标dump_qml_context_properties ,该目标会使用正确的参数调用qmlcontextpropertydump 。请注意,如果导出文件已存在,dump_qml_context_properties 将不执行任何操作。请使用clean_qml_context_properties 目标来删除上下文属性导出文件。上下文属性导出文件位于构建文件夹的<build>/.qt/contextPropertyDump.ini 路径下。

© 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.