clang-format: Add more default statement macros

To prevent unwanted indentation of Qt code.

Change-Id: I9dac81c3bbda5e1e7635f93f096b49df9ee92265
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2021-05-12 17:06:19 +02:00
parent 55f768e1b0
commit b1dbeafd44

View File

@@ -162,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;