From e4f99e0285cca44e72004f01f57670d0e81e7679 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Wed, 31 Jul 2013 18:43:42 +0200 Subject: 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 " 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 --- src/tools/qdoc/htmlgenerator.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/tools/qdoc/htmlgenerator.cpp') 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 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() << "" << " " - << *i + << *i << ":" << " "; if (*i == headerText) -- cgit v1.2.3