欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 游戏 > cursor+QT5.12.12

cursor+QT5.12.12

2025/7/4 10:28:34 来源:https://blog.csdn.net/gaoenyang760525/article/details/143636555  浏览:    关键词:cursor+QT5.12.12

一、QT相关

1、环境设置相关

2、安装插件:

在CURSOR中安装以下插件:

C/C++插件:这是必需的,用于支持C/C++语言开发。
Qt Configure:用于配置Qt环境。
Qt Tools:提供Qt相关的工具支持。
CMake:如果你使用的是Qt6或更高版本,需要使用CMake而不是qmake。
CMake Tools:辅助CMake构建的工具。

3、配置C/C++插件:

使用快捷键 Ctrl+Shift+P 打开命令面板,输入 C++,选择编辑配置.

c_cpp_properties.json文件如下:

{"configurations": [{"name": "Win32","includePath": ["${workspaceFolder}/**","C:/Qt/Qt5.12.12/5.12.12/mingw73_64/include","C:/Qt/Qt5.12.12/5.12.12/mingw73_64/include/QtWidgets"],"defines": ["_DEBUG","UNICODE","_UNICODE"],"windowsSdkVersion": "10.0.22000.0","compilerPath": "cl.exe","cStandard": "c17","cppStandard": "c++17","intelliSenseMode": "windows-msvc-x64"}],"version": 4
}

4、新建Qt项目

千万记得去掉debug和release的shadow.(去掉之后编译一下才生效)

二、CURSOR相关

1、tasks.json

{"version": "2.0.0","tasks": [{"label": "qmake-debug","type": "shell","command": "qmake","args": ["C:/Users/Administrator/Documents/untitled16/untitled16.pro","CONFIG+=debug"],"group": {"kind": "build","isDefault": true},"problemMatcher": []},{"label": "qmake-release","type": "shell","command": "qmake","args": ["C:/Users/Administrator/Documents/untitled16/untitled16.pro","CONFIG+=release"],"group": "build","problemMatcher": []},{"label": "make-debug","type": "shell","command": "mingw32-make","dependsOn": "qmake-debug","group": {"kind": "build","isDefault": true},"problemMatcher": ["$gcc"]},{"label": "make-release","type": "shell","command": "mingw32-make","dependsOn": "qmake-release","group": "build","problemMatcher": ["$gcc"]}]
}

2、c_cpp_properties.json

{"configurations": [{"name": "Win32","includePath": ["${workspaceFolder}/**","C:/Qt/Qt5.12.12/5.12.12/mingw73_64/include","C:/Qt/Qt5.12.12/5.12.12/mingw73_64/include/QtWidgets"],"defines": ["_DEBUG","UNICODE","_UNICODE"],"windowsSdkVersion": "10.0.22000.0","compilerPath": "cl.exe","cStandard": "c17","cppStandard": "c++17","intelliSenseMode": "windows-msvc-x64"}],"version": 4
}

这样,就可以run task,先qmake,后make

注意,生成的release版本的exe文件,需要windeployqt 打包一下,否则执行的时候会提示入口错误。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词