代码改变世界

qt code format style

2024-06-18 08:38  @学无止境  阅读(6)  评论(0编辑  收藏  举报

参考:https://www.cnblogs.com/ybqjymy/p/18003463 

帮助-->关于插件

 

把clang-format.exe 放在D:\Q5.15\Tools\QtCreator\bin\clang\bin目录下

 

 

{
BasedOnStyle: Google,
AccessModifierOffset: -2,
AlignAfterOpenBracket: Align,
AlignConsecutiveAssignments: false,
AlignConsecutiveDeclarations: false,
AlignEscapedNewlines: DontAlign,
AlignOperands: true,
AllowAllParametersOfDeclarationOnNextLine: true,
AllowShortBlocksOnASingleLine: true,
AllowShortCaseLabelsOnASingleLine: true,
AllowShortFunctionsOnASingleLine: Empty,
AllowShortIfStatementsOnASingleLine: false,
AllowShortLoopsOnASingleLine: false,
AlwaysBreakAfterDefinitionReturnType: None,
AlwaysBreakAfterReturnType: None,
AlwaysBreakBeforeMultilineStrings: false,
AlwaysBreakTemplateDeclarations: true,
AlwaysBreakAfterDefinitionReturnType: None,
AlwaysBreakAfterReturnType: None,
AlwaysBreakBeforeMultilineStrings: false,
AlwaysBreakTemplateDeclarations: true,
BinPackArguments: true,
BinPackParameters: true,
BreakBeforeBinaryOperators: None,
BreakBeforeBraces: Attach,
BreakBeforeTernaryOperators: false,
BreakConstructorInitializers: BeforeComma,
BreakStringLiterals: true,
ColumnLimit: 120,
CommentPragmas: '^ IWYU pragma:',
CompactNamespaces: false,
ConstructorInitializerAllOnOneLineOrOnePerLine: false,
ConstructorInitializerIndentWidth: 4,
ContinuationIndentWidth: 4,
Cpp11BracedListStyle: true,
DerivePointerAlignment: false,
DisableFormat: false,
ExperimentalAutoDetectBinPacking: false,
FixNamespaceComments: true,
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ],
IncludeBlocks: Regroup,
IndentCaseLabels: true,
IndentPPDirectives: AfterHash,
IndentWidth: 4,
IndentWrappedFunctionNames: true,
KeepEmptyLinesAtTheStartOfBlocks: false,
MacroBlockBegin: '',
MacroBlockEnd: '',
MaxEmptyLinesToKeep: 1,
NamespaceIndentation: All,
ObjCBlockIndentWidth: 4,
ObjCSpaceAfterProperty: false,
ObjCSpaceBeforeProtocolList: true,
PenaltyBreakBeforeFirstCallParameter: 19,
PenaltyBreakComment: 300,
PenaltyBreakFirstLessLess: 120,
PenaltyBreakString: 1000,
PenaltyExcessCharacter: 1000000,
PenaltyReturnTypeOnItsOwnLine: 60,
PointerAlignment: Left,
ReflowComments: true,
SortIncludes: true,
SpaceAfterCStyleCast: false,
SpaceAfterTemplateKeyword: true,
SpaceBeforeAssignmentOperators: true,
SpaceBeforeParens: ControlStatements,
SpaceInEmptyParentheses: false,
SpacesBeforeTrailingComments: 2,
SpacesInAngles: false,
SpacesInContainerLiterals: false,
SpacesInCStyleCastParentheses: false,
SpacesInParentheses: false,
SpacesInSquareBrackets: false,
TabWidth: 4,
UseTab: Never,
}