I wrote a patch for astyle that makes it work with the Qt control headers (forever, Q_FOREVER, foreach, Q_FOREACH). Not just to fix the wrong space after the keyword, but also everything inside the parenthesis, leading to things like:
Q_FOREACH(const QString & it, l) // note the space after the '&'.
when running astyle with -n -Q --indent=spaces=4 --style=otbs \
--indent-labels --pad-oper --unpad-paren --pad-header \
--keep-one-line-statements --convert-tabs \
The patch is here: http://www.davidfaure.fr/kde/astyle_qt.diff
I would be happy to see it merged into upstream astyle.
But I can also understand a reply like "this is Qt specific" ... it is.
Maybe we could have a command-line argument with the list of "headers" to support, then?
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.