在本页

启用 QML 调试

为项目启用 QML 调试:

  1. 在Solution Explorer 中,右键单击项目,在右键菜单中选择Properties 。
  2. 选择Configuration Properties >Qt Project Settings 。
  3. 在Enable QML Debugging 中,选择Yes 。

    为项目启用 QML 调试

  4. 选择OK 以保存项目设置。
  5. 转到Build >Rebuild Solution 重建项目。

禁用 QML 调试

禁止 QML 调试引擎处理所有 QML 调试事件:

  1. 转到Extensions >Qt VS Tools >Options >Qt >General >QML Debugging 。

    Qt 常规选项中的 QML 调试

  2. 将Process debug events 设置为False 。

这实际上将 QML 调试引擎排除在调试环境之外,并禁止调试所有项目的 QML 代码。

设置调试连接超时

以毫秒为单位增加或减少调试连接超时:

  1. 转到Extensions >Qt VS Tools >Options >Qt >General >QML Debugging 。
  2. 设置Runtime connection timeout 的值,单位为毫秒。

要取消超时,请将其值设为Disabled 。

另请参阅 教程:Qt Quick 调试、交叉编译、调试应用程序、在 Linux 上调试,以及调试Qt Quick 应用程序。

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