summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/codeparser.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/codeparser.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/codeparser.cpp')
-rw-r--r--src/tools/qdoc/codeparser.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
index 97a3d20263..1be67894cc 100644
--- a/src/tools/qdoc/codeparser.cpp
+++ b/src/tools/qdoc/codeparser.cpp
@@ -65,6 +65,7 @@ QT_BEGIN_NAMESPACE
#define COMMAND_PAGEKEYWORDS Doc::alias(QLatin1String("pagekeywords"))
#define COMMAND_PRELIMINARY Doc::alias(QLatin1String("preliminary"))
#define COMMAND_INPUBLICGROUP Doc::alias(QLatin1String("inpublicgroup"))
+#define COMMAND_QTVARIABLE Doc::alias(QLatin1String("qtvariable"))
#define COMMAND_REENTRANT Doc::alias(QLatin1String("reentrant"))
#define COMMAND_SINCE Doc::alias(QLatin1String("since"))
#define COMMAND_SUBTITLE Doc::alias(QLatin1String("subtitle"))
@@ -218,6 +219,7 @@ const QSet<QString>& CodeParser::commonMetaCommands()
<< COMMAND_PAGEKEYWORDS
<< COMMAND_PRELIMINARY
<< COMMAND_INPUBLICGROUP
+ << COMMAND_QTVARIABLE
<< COMMAND_REENTRANT
<< COMMAND_SINCE
<< COMMAND_SUBTITLE
@@ -321,6 +323,15 @@ void CodeParser::processCommonMetaCommand(const Location& location,
else
location.warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE));
}
+ else if (command == COMMAND_QTVARIABLE) {
+ if (node->subType() == Node::Module) {
+ DocNode *dn = static_cast<DocNode *>(node);
+ dn->setQtVariable(arg.first);
+ }
+ else
+ location.warning(tr("Command '\\%1' found outside of '\\module'. It can only be used within a module page.")
+ .arg(COMMAND_QTVARIABLE));
+ }
}
/*!