summaryrefslogtreecommitdiff
path: root/src/plugins/clangformat/clangformatutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/clangformat/clangformatutils.cpp')
-rw-r--r--src/plugins/clangformat/clangformatutils.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp
index a249327d0e..2f9a306b99 100644
--- a/src/plugins/clangformat/clangformatutils.cpp
+++ b/src/plugins/clangformat/clangformatutils.cpp
@@ -145,7 +145,11 @@ static clang::format::FormatStyle qtcStyle()
style.PenaltyReturnTypeOnItsOwnLine = 300;
style.PointerAlignment = FormatStyle::PAS_Right;
style.ReflowComments = false;
+#if LLVM_VERSION_MAJOR >= 13
+ style.SortIncludes = FormatStyle::SI_CaseSensitive;
+#else
style.SortIncludes = true;
+#endif
style.SortUsingDeclarations = true;
style.SpaceAfterCStyleCast = true;
style.SpaceAfterTemplateKeyword = false;
@@ -158,6 +162,9 @@ static clang::format::FormatStyle qtcStyle()
style.SpacesInCStyleCastParentheses = false;
style.SpacesInParentheses = false;
style.SpacesInSquareBrackets = false;
+ style.StatementMacros.emplace_back("Q_OBJECT");
+ style.StatementMacros.emplace_back("QT_BEGIN_NAMESPACE");
+ style.StatementMacros.emplace_back("QT_END_NAMESPACE");
style.Standard = FormatStyle::LS_Cpp11;
style.TabWidth = 4;
style.UseTab = FormatStyle::UT_Never;
@@ -188,7 +195,7 @@ static bool useProjectOverriddenSettings()
static Utils::FilePath globalPath()
{
- return Utils::FilePath::fromString(Core::ICore::userResourcePath());
+ return Core::ICore::userResourcePath();
}
static Utils::FilePath projectPath()