QT_QMLLINT_CONTEXT_PROPERTY_DUMP

启用在 lint 目标中转储上下文属性。

该变量于 Qt 6.11 版本中引入。

当启用QT_QMLLINT_CONTEXT_PROPERTY_DUMP 变量时,由qt_add_qml_module()创建的lint目标将在运行qmllint之前先运行qmlcontextpropertydump。这使得qmllint能够针对QML中上下文属性的使用发出警告。

要启用此功能,请使用以下任一方法设置QT_QMLLINT_CONTEXT_PROPERTY_DUMP 变量:

  • 将该选项传递给 CMake 可执行文件:
    -DQT_QMLLINT_CONTEXT_PROPERTY_DUMP=ON
  • 在首次调用qt_add_qml_module() 之前,将该设置添加到您的CMakeLists.txt 文件中:
    set(QT_QMLLINT_CONTEXT_PROPERTY_DUMP ON)

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