在本页

为项目选择 Qt 版本

为项目选择默认 Qt 版本以外的其他 Qt 版本:

  1. 在Solution Explorer 中,右键单击项目,在右键菜单中转入Properties 。
  2. 选择Configuration Properties >Qt Project Settings 。

    Qt 项目设置对话框

  3. 在Qt Installation 中,选择 Qt 版本。

CMake 项目

当您创建或加载 Qt 应用程序项目时,Qt VS Tools 会为您创建必要的文件:CMakePresets.json 和 CMakeUserPresets.json。

为 CMake 项目选择 Qt 版本:

  1. 在 CMakeUserPresets.json 文件中,找到显示名称与配置相符的可见预设(即不包含文本"hidden":true )。
  2. 在该预设中,将"inherits" 属性设置为目标 Qt 版本的注册名称,如Tools >Options >Qt >Versions 所示。

    如果预设继承自预设列表,请确保目标 Qt 版本是列表中唯一引用的 Qt 版本。

    要选择默认 Qt 版本,请使用"Qt-Default" 。

隐藏更改通知

Qt VS Tools 在更改预设时会显示通知。要隐藏通知,请

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

    Qt 常规选项中的通知

  2. 在Qt VS Tools-managed CMake presets modified 中,选择Disable 。

另请参阅 添加 Qt 版本和交叉编译。

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