合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
[TOC] ## 安装插件 安装 `Qt C++ Extension Pack` ,可以添加相关的插件 ## .vscode <details> <summary>.vscode/c_cpp_properties.json</summary> ``` { "configurations": [ { "name": "msvc2022_64", "includePath": [ "C:/Qt/6.7.3/msvc2022_64/include/**", "C:/Qt/6.7.3/msvc2022_64/include/QtWidgets/**", "${workspaceRoot}/**" ], "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/x64/bin/clang++.exe", "cStandard": "c17", "cppStandard": "c++17" } ], "version": 4 } ``` </details> <details> <summary> .vscode/tasks.json</summary> ``` { "version": "2.0.0", "tasks": [ { "label": "qmake", "type": "shell", "command": "qmake", "args": [ "../untitled6.pro" ], "options": { "cwd": "${workspaceFolder}/build" }, "group": { "kind": "build", "isDefault": true } }, { "label": "build_debug", "type": "shell", "command": "cmd", "args": [ "/C", "call \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat\" amd64 && C:\\Qt\\Tools\\QtCreator\\bin\\jom\\jom.exe -f ./Makefile.Debug" ], "options": { "cwd": "${workspaceFolder}/build" }, "group": { "kind": "build", "isDefault": true }, "dependsOn": [ // 如何不修改 .pro 文件, 可以不用 qmake // "clean", // "qmake" ], "problemMatcher": [ "$msCompile" ] }, { "label": "build_release", "type": "shell", "command": "cmd", "args": [ "/C", "call \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat\" amd64 && C:\\Qt\\Tools\\QtCreator\\bin\\jom\\jom.exe -f ./Makefile.Release" ], "options": { "cwd": "${workspaceFolder}/build" }, "group": { "kind": "build", "isDefault": true }, "dependsOn": [ "clean", "qmake" ], }, { "label": "deploy_dependencies", "type": "process", "command": "windeployqt", "args": [ "--release", "--qmldir", "${workspaceFolder}/qml", "${workspaceFolder}/build/release/untitled6.exe" ], "options": { "cwd": "${workspaceFolder}/build/release" }, "group": "build", "dependsOn": [ "build_release" ], "problemMatcher": [] }, { "label": "clean", "type": "shell", "command": "C:\\Qt\\Tools\\QtCreator\\bin\\jom\\jom.exe", "args": ["clean"], "options": { "cwd": "${workspaceFolder}/build" } } ] } ``` </details> <details> <summary>.vscode/launch.json</summary> ``` { "version": "0.2.0", "configurations": [ { "name": "gdb", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/debug/${workspaceFolderBasename}.exe",//程序可执行文件的完整路径。 "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "MIMode": "gdb", "miDebuggerPath": "C:\\Qt\\Tools\\mingw1120_64\\bin\\gdb.exe", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true } ], // 调试之前先编译一下,即对应tasks.json任务中的make "preLaunchTask": "build_debug",//与tasks.json文件里的label名对应 } ] } ``` </details> > 添加 lanuch.json ,但是 debug 失效 > c_cpp_properties.json 好像可以不需要