vscode 配置构建、调试QT项目

时间:2024-10-23 07:13:28

1. 背景是已经安装好了QT和QT相关的所有依赖包 https://mp.****.net/mp_blog/creation/editor/142974086
2. 配置环境变量

找不到或者忘记在哪里可以使用指令查询

3.插件安装Qt Support、 Qt tools、Qt UI等


Cmake、Cmake Tools 等

C/C++等

settings.json 配置
此部分是根据一些报错进行配置更新的

vscode:插件报错:_unable to determine what cmake generator to use. p-****博客

{
  "workbench.colorTheme": "Default Dark Modern",
  "git.autofetch": true,
  "settingsSync.ignoredSettings": [],
  "editor.tabSize": 2,
  "eslint.format.enable": true,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "liveServer.settings.donotShowInfoMsg": true,
  "javascript.format.enable": false,
  "js/ts.implicitProjectConfig.target": "ESNext",
  "editor.codeActionsOnSave": {},
  "editor.detectIndentation": false,
  "[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[dart]": {
    "editor.formatOnSave": false,
    "editor.formatOnType": true,
    "editor.rulers": [80],
    "editor.selectionHighlight": false,
    "editor.suggestSelection": "first",
    "editor.tabCompletion": "onlySnippets",
    "editor.wordBasedSuggestions": "off"
  },
  "editor.fontLigatures": false,
  "window.zoomLevel": 2,
  "cssrem.rootFontSize": 37.5,
  "git.confirmSync": false,
  "cmake.generator": "MinGW Makefiles",
  "cmake.pinnedCommands": [
    "workbench.action.tasks.configureTaskRunner",
    "workbench.action.tasks.runTask"
  ],
  "cmake.options.statusBarVisibility": "visible",
  "cmake.cmakePath": "C:\\Users\\Administrator\\Desktop\\qtServer\\Tools\\CMake_64\\bin\\cmake.exe",
  "qt-support.qtInstallDirectories": [],
  "cmake.additionalKits": [
    "C:\\Users\\Administrator\\AppData\\Local\\qt-support\\qt-kits.json"
  ],
  "C_Cpp.intelliSenseEngine": "disabled"
}



点击下图左下角,选择Qt 6.7.3....

开启构建,成功构建 ,几个调试、构建操作