diff options
author | Topi Reinio <topi.reinio@qt.io> | 2019-05-02 12:58:57 +0200 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2019-05-06 11:51:39 +0000 |
commit | 9a514b9791297afcf237a453a4eb5d89b9be3af5 (patch) | |
tree | b7ceb79fc25bab17596390673536ee44b2129225 /src/qdoc | |
parent | 0f92411b53d653b0285f7c8919b2a682808167e5 (diff) | |
download | qttools-9a514b9791297afcf237a453a4eb5d89b9be3af5.tar.gz |
qdoc: Fix \headerfile requisite table and title generation
Using \headerfile did not call addIncludeFile() on the Aggregate, so the
requisite table in the generated HTML contained an empty '#include <>'
statement.
Also, remove the 'Header' prefix from the generated title, as it
produced titles that look odd, e.g. 'Header Global Qt Declarations'.
Replace the title with a full title that contains the name of the
header file, e.g. '<QtGlobal> - Global Qt Declarations'.
Task-number: QTBUG-75570
Change-Id: Iccc248dcbcbfee85ca15e802e671ffcf9b9c10fe
Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc')
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 4 | ||||
-rw-r--r-- | src/qdoc/node.cpp | 9 | ||||
-rw-r--r-- | src/qdoc/node.h | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 235b01470..4ce0b9b69 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -1401,9 +1401,7 @@ void HtmlGenerator::generateCppReferencePage(Aggregate *aggregate, CodeMarker *m detailsSections = §ions.stdCppClassDetailsSections(); } else if (aggregate->isHeader()) { - rawTitle = aggregate->title(); - fullTitle = aggregate->fullTitle(); - title = "Header " + rawTitle; + title = fullTitle = rawTitle = aggregate->fullTitle(); summarySections = §ions.stdSummarySections(); detailsSections = §ions.stdDetailsSections(); } diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index a771f180c..26e042e25 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -1870,6 +1870,15 @@ FunctionNode* ClassNode::findOverriddenFunction(const FunctionNode* fn) \brief This class represents a C++ header file. */ +HeaderNode::HeaderNode(Aggregate* parent, const QString& name) : Aggregate(HeaderFile, parent, name) +{ + // Add the include file with enclosing angle brackets removed + if (name.startsWith(QChar('<')) && name.length() > 2) + Aggregate::addIncludeFile(name.mid(1).chopped(1)); + else + Aggregate::addIncludeFile(name); +} + /*! \class PageNode */ diff --git a/src/qdoc/node.h b/src/qdoc/node.h index 426e28753..a40f4d766 100644 --- a/src/qdoc/node.h +++ b/src/qdoc/node.h @@ -643,7 +643,7 @@ private: class HeaderNode : public Aggregate { public: - HeaderNode(Aggregate* parent, const QString& name) : Aggregate(HeaderFile, parent, name) { } + HeaderNode(Aggregate* parent, const QString& name); virtual ~HeaderNode() { } bool isFirstClassAggregate() const override { return true; } bool isRelatableType() const override { return true; } |