@@ -384,6 +384,10 @@ class AnnotatingParser {
384384 OpeningParen.Previous ->is (tok::kw__Generic)) {
385385 Contexts.back ().ContextType = Context::C11GenericSelection;
386386 Contexts.back ().IsExpression = true ;
387+ } else if (OpeningParen.Previous &&
388+ OpeningParen.Previous ->TokenText == " Q_PROPERTY" ) {
389+ Contexts.back ().ContextType = Context::QtProperty;
390+ Contexts.back ().IsExpression = false ;
387391 } else if (Line.InPPDirective &&
388392 (!OpeningParen.Previous ||
389393 OpeningParen.Previous ->isNot (tok::identifier))) {
@@ -1803,6 +1807,11 @@ class AnnotatingParser {
18031807 return false ;
18041808 }
18051809 }
1810+ if (Style.AllowBreakBeforeQtProperty &&
1811+ Contexts.back ().ContextType == Context::QtProperty &&
1812+ Tok->isQtProperty ()) {
1813+ Tok->setFinalizedType (TT_QtProperty);
1814+ }
18061815 break ;
18071816 case tok::arrow:
18081817 if (Tok->isNot (TT_LambdaArrow) && Prev && Prev->is (tok::kw_noexcept))
@@ -2169,6 +2178,7 @@ class AnnotatingParser {
21692178 TemplateArgument,
21702179 // C11 _Generic selection.
21712180 C11GenericSelection,
2181+ QtProperty,
21722182 // Like in the outer parentheses in `ffnand ff1(.q());`.
21732183 VerilogInstancePortList,
21742184 } ContextType = Unknown;
@@ -6254,7 +6264,7 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
62546264 Right.Next ->isOneOf (TT_FunctionDeclarationName, tok::kw_const)));
62556265 }
62566266 if (Right.isOneOf (TT_StartOfName, TT_FunctionDeclarationName,
6257- TT_ClassHeadName, tok::kw_operator)) {
6267+ TT_ClassHeadName, TT_QtProperty, tok::kw_operator)) {
62586268 return true ;
62596269 }
62606270 if (Left.is (TT_PointerOrReference))
0 commit comments