diff options
author | Topi Reinio <topi.reinio@qt.io> | 2017-02-07 15:37:43 +0100 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2017-02-14 09:38:53 +0000 |
commit | 4455a6464e783884fdab1e9f7aaadaf42be85468 (patch) | |
tree | 3cdf241b769f040336fe911c2df726cfddd58dce /src/qdoc/doc.cpp | |
parent | cff0a9551e18e82793d454400a86438ffecee99a (diff) | |
download | qttools-4455a6464e783884fdab1e9f7aaadaf42be85468.tar.gz |
qdoc: Improve \brief handling
There were several issues with how \brief text was generated,
especially for C++ properties and variables. This commit changes
the \brief generation by:
- Preface a brief with 'This property holds ...' only if the
produced text is more or less grammatically sound.
- Eliminates 'This property holds this property holds' duplicates.
- Allow any formatting within a \brief. Previously, input like
"\brief \c true" produced no output.
The last issue is fixed also for brief attributes written to index
files, although there we cannot retain the formatting. In order to
do this, the Generator::plainCode() function was made static.
Change-Id: If5b3b7e626e87116c3d8d3c1f777d604e4647eb8
Task-number: QTBUG-58280
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/doc.cpp')
-rw-r--r-- | src/qdoc/doc.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp index d401bf58d..031b7729a 100644 --- a/src/qdoc/doc.cpp +++ b/src/qdoc/doc.cpp @@ -2968,8 +2968,11 @@ Text Doc::trimmedBriefText(const QString &className) const should be rethought. */ while (atom) { - if (atom->type() == Atom::AutoLink || atom->type() == Atom::String) { + if (atom->type() == Atom::AutoLink + || atom->type() == Atom::String) { briefStr += atom->string(); + } else if (atom->type() == Atom::C) { + briefStr += Generator::plainCode(atom->string()); } atom = atom->next(); } |