默认情况下有no line break在 Qt Creator 中的左大括号之前。我怎样才能覆盖这种行为?
最佳答案
有很多工具可以实现这一点,“艺术风格”是我使用的一个。 http://astyle.sourceforge.net/
安装艺术风格
QtCreator -> 工具 -> 选项 -> 美化器
(如果它不存在,请在“帮助”->“关于插件...”中启用它)
在“艺术风格”选项卡上选中“使用自定义风格”并单击“编辑”
在文本框中输入“--style=allman”(不带引号),然后确定,确定。
然后是工具 -> 美化器 -> 艺术风格 -> 设置当前文件格式
要查看所有可用选项(以及“--style=allman”的作用),请参阅 http://astyle.sourceforge.net/astyle.html#_Bracket_Style_Options
关于coding-style - Qt Creator 编码风格 : How to force new line before the opening brace?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18072930/