summaryrefslogtreecommitdiff
path: root/src/qdoc/doc.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2017-02-07 15:37:43 +0100
committerTopi Reiniƶ <topi.reinio@qt.io>2017-02-14 09:38:53 +0000
commit4455a6464e783884fdab1e9f7aaadaf42be85468 (patch)
tree3cdf241b769f040336fe911c2df726cfddd58dce /src/qdoc/doc.cpp
parentcff0a9551e18e82793d454400a86438ffecee99a (diff)
downloadqttools-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.cpp5
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();
}