Qt代码美化——Astyle

材料:Qt Createor、AStyle*.zip

1.下载并解压AStyle*.zip
下载链接(https://sourceforge.net/projects/astyle/files/)
解压至你可以找到的目录即可

2.Qt Creator设置
开启beautiful插件
Qt代码美化——Astyle
Qt代码美化——Astyle
这里是AStyle.exe的路径
Qt代码美化——Astyle
点击edit
Qt代码美化——Astyle
添加如下代码

--style=allman
indent=spaces=4	      # 缩进采用4个空格
indent-switches           # -S  设置 switch 整体缩进
indent-cases 	      # -K  设置 cases 整体缩进
indent-namespaces         # -N  设置 namespace 整体缩进
indent-preproc-block      # -xW 设置预处理模块缩进
indent-preproc-define     # -w  设置宏定义模块缩进	
pad-oper                  # -p  操作符前后填充空格
#delete-empty-lines       # -xe 删除多余空行
#add-braces               # -j  单行语句加上大括号
#align-pointer=name       # *、&这类字符靠近变量名字
align-pointer=type        # *、&这类字符靠近类型

然后
Qt代码美化——Astyle

还可以设置快捷键
Qt代码美化——Astyle



参考链接:https://blog.csdn.net/qq_33154343/article/details/101397429

Qt代码美化——Astyle

上一篇:crond定时任务调度


下一篇:压缩字符串 -- LeetCode -- 8.21