Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 14.0.2
-
None
-
d66163c09 (15.0)
Description
When emitting the signal of a QObject returned by a function, clang-format adds spaces around ->
// We have the following function: MyObject *getObject(); // With clang-format 17 and before emit getObject()->mySignal(); Q_EMIT getObject()->mySignal(); // With clang-format 18 emit getObject() -> mySignal(); Q_EMIT getObject() -> mySignal();
clang-format 19+ has the same behavior than clang-format 18,
but setting StatementAttributeLikeMacros: [emit, Q_EMIT] restores the old behavior.
StatementAttributeLikeMacros with clang-format 18 does not have any effect on this issue.
Given that it is an upstream bug, the only required fixes would be to:
- not use clang-format 18
- add emit to StatementAttributeLikeMacros in Qt built-in style, as only Q_EMIT is set for now.