diff options
author | Topi Reinio <topi.reinio@digia.com> | 2015-10-07 12:07:22 +0200 |
---|---|---|
committer | Topi Reiniö <topi.reinio@digia.com> | 2015-10-13 11:55:54 +0000 |
commit | dab4877a0a6ad755483a8e47205112a247058fef (patch) | |
tree | 6344f42229bfa53b773e4592f2c16a9f356b7e79 /src/tools/qdoc/codemarker.cpp | |
parent | ee634611d4d78d7ee66b79dc765abab231391eab (diff) |
qdoc: Improve formatting of function signatures
This is a continuation of the work started in commit
694d30035593addc377fea374d1dbe8e3f5ca503.
Attach reference ('&') and pointer ('*') qualifiers to the
parameter name, as per Qt coding style.
Previously, function signatures were documented like this:
QString & QString::append(const QString & str)
After this change, they will appear like this:
QString &QString::append(const QString &str)
Change-Id: Ie103fc2929635bc32145e50469c600f9f378f97c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/codemarker.cpp')
-rw-r--r-- | src/tools/qdoc/codemarker.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index 458799fc27..a668205a66 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -210,7 +210,7 @@ void CodeMarker::appendProtectedString(QString *output, const QStringRef &str) } } -QString CodeMarker::typified(const QString &string) +QString CodeMarker::typified(const QString &string, bool trailingSpace) { QString result; QString pendingWord; @@ -254,6 +254,11 @@ QString CodeMarker::typified(const QString &string) } } } + if (trailingSpace && string.size()) { + if (!string.endsWith(QLatin1Char('*')) + && !string.endsWith(QLatin1Char('&'))) + result += QLatin1Char(' '); + } return result; } |