summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/htmlgenerator.cpp
diff options
context:
space:
mode:
authorJerome Pasion <jerome.pasion@digia.com>2013-07-31 18:43:42 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-02 13:35:37 +0200
commite4f99e0285cca44e72004f01f57670d0e81e7679 (patch)
treea1caaf219f35e8e12fb357c4a3ac7b5fb3eed529 /src/tools/qdoc/htmlgenerator.cpp
parent0ace3112137b78cf7d150e9974e69ccfe6838533 (diff)
Doc: Added \qtvariable command to QDoc.
Specifies the QT variable needed in the .pro file. The argument of the command is the qmake QT variable. To use, add "\qtvariable <value>" to a QDoc comment which contains the \module command. QDoc will then associate the class with the QT variable. Only supported for C++ classes at the moment. Part of work done for QTBUG-32172 Task-number: QTBUG-32172 Change-Id: Ia8eea30fcfc771191c23a5f5994a48732959ea49 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/htmlgenerator.cpp')
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index b307d9c19b..54861f4e02 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -1835,11 +1835,12 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
QMap<QString, Text> requisites;
Text text;
- const QString headerText = "Header:";
- const QString sinceText = "Since:";
- const QString inheritedBytext = "Inherited By:";
- const QString inheritsText = "Inherits:";
- const QString instantiatedByText = "Instantiated By:";
+ const QString headerText = "Header";
+ const QString sinceText = "Since";
+ const QString inheritedBytext = "Inherited By";
+ const QString inheritsText = "Inherits";
+ const QString instantiatedByText = "Instantiated By";
+ const QString qtVariableText = "qmake";
//add the includes to the map
if (!inner->includes().isEmpty()) {
@@ -1856,6 +1857,7 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
//The order of the requisites matter
QStringList requisiteorder;
requisiteorder << headerText
+ << qtVariableText
<< sinceText
<< instantiatedByText
<< inheritsText
@@ -1932,6 +1934,16 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
requisites.insert(inheritedBytext, text);
}
+ //add the QT variable to the map
+ DocNode * moduleNode = qdb_->findModule(classe->moduleName());
+ if (moduleNode || !moduleNode->qtVariable().isEmpty()) {
+ text.clear();
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_TELETYPE)
+ << "QT += " + moduleNode->qtVariable()
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_TELETYPE);
+ requisites.insert(qtVariableText, text);
+ }
+
}
if (!requisites.isEmpty()) {
@@ -1944,7 +1956,7 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
if (requisites.contains(*i)) {
out() << "<tr>"
<< "<td class=\"memItemLeft rightAlign topAlign\"> "
- << *i
+ << *i << ":"
<< "</td><td class=\"memItemRight bottomAlign\"> ";
if (*i == headerText)