1
+ # Copyright (C) 2016 Olivier Goffart <[email protected] >
2
+ #
3
+ # You may use this file under the terms of the 3-clause BSD license.
4
+ # See the file LICENSE from this package for details.
5
+
6
+ # This is the clang-format configuration style to be used by Qt,
7
+ # based on the rules from https://wiki.qt.io/Qt_Coding_Style and
8
+ # https://wiki.qt.io/Coding_Conventions
9
+
10
+ ---
11
+ # Webkit style was loosely based on the Qt style
12
+ BasedOnStyle : WebKit
13
+
14
+ Standard : c++17
15
+ ColumnLimit : 160
16
+
17
+ # Disable reflow of qdoc comments: indentation rules are different.
18
+ # Translation comments are also excluded
19
+ CommentPragmas : " ^!|^:"
20
+
21
+ # We want a space between the type and the star for pointer types
22
+ PointerBindsToType : false
23
+
24
+ # We want to break before the operators, but not before a '='
25
+ BreakBeforeBinaryOperators : NonAssignment
26
+
27
+ # Braces are usually attached, but not after functions or classes declaration
28
+ BreakBeforeBraces : Custom
29
+ BraceWrapping :
30
+ AfterClass : true
31
+ AfterControlStatement : false
32
+ AfterEnum : false
33
+ AfterFunction : true
34
+ AfterNamespace : false
35
+ AfterObjCDeclaration : false
36
+ AfterStruct : true
37
+ AfterUnion : false
38
+ BeforeCatch : false
39
+ BeforeElse : false
40
+ IndentBraces : false
41
+
42
+ # The coding style does not specify the following, but this is what gives
43
+ # results closest to the existing code.
44
+ AlignAfterOpenBracket : DontAlign
45
+ AlwaysBreakTemplateDeclarations : true
46
+
47
+ # Ideally we should also allow less short function in a single line, but
48
+ # clang-format does not handle that
49
+ AllowShortFunctionsOnASingleLine : Inline
50
+
51
+ SortIncludes : true
52
+
53
+ # macros for which the opening brace stays attached
54
+ ForEachMacros : [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
55
+
56
+ # Allow two empty lines for structuring
57
+ MaxEmptyLinesToKeep : 2
58
+ KeepEmptyLinesAtTheStartOfBlocks : false
59
+
60
+ # Properly format c++11 initializer
61
+ SpaceBeforeCpp11BracedList : false
62
+ Cpp11BracedListStyle : true
0 commit comments