1、安装clang-format
sudo apt install clang-format
2、添加插件Beautifier
在QtCreator–>Help–>About Plugins…中添加插件Beautifer,添加后要重启QtCreator
ClangCodeModel是否需要不清楚?反正我添加了
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210113201341925.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTAxNjg3ODE=,size_16,color_FFFFFF,t_70#pic_center)
3、配置Clang Format
在Tools --> Options…–>Beautifier中配合Clang Format
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210113201353867.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTAxNjg3ODE=,size_16,color_FFFFFF,t_70#pic_center)
4、设置快捷键
在Tools --> Options…–>Environment–>Keyboard中找到ClangF
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)