summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/puredocparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2015-02-13 13:00:22 +0100
committerMartin Smith <martin.smith@digia.com>2015-02-20 11:37:18 +0000
commit62a2f46d290c67343366cb4f707830fe7d8b3d63 (patch)
tree4bde42e59c1d54e93fa42d2050f955782bc17ca9 /src/tools/qdoc/puredocparser.cpp
parentfe7c2662b5a6a458459bf11b8d06a2b34318918d (diff)
qdoc: Support documentation of JavaScript
This update provides the actual support for documenting JavaScript. It has been tested with JavaScript commands in qdoc comments in .qdoc files but not in .js files. Currently, we have the use case of needing to document JavaScript using qdoc comments in .qdoc files. For each qdoc command for QML, i.e. \qmltype, \qmlproperty, etc, there is now a corresponding JavaScript command, i.e. \jstype, \jsproperty, etc. Some of these might not be needed, but they are all provided. Briefly, document JavaScript in a .qdoc file the same way you would document QML in a .qdoc file, but instead of using the \qmlxxx commands, use \jsxxx commands. Change-Id: Ib68a5f66c16472af87d9f776db162332ca13fbb7 Task-number: QTBUG-43715 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/puredocparser.cpp')
-rw-r--r--src/tools/qdoc/puredocparser.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tools/qdoc/puredocparser.cpp b/src/tools/qdoc/puredocparser.cpp
index 1d270e7150..7029431460 100644
--- a/src/tools/qdoc/puredocparser.cpp
+++ b/src/tools/qdoc/puredocparser.cpp
@@ -133,6 +133,7 @@ bool PureDocParser::processQdocComments()
QString topic;
bool isQmlPropertyTopic = false;
+ bool isJsPropertyTopic = false;
const TopicList& topics = doc.topicsUsed();
if (!topics.isEmpty()) {
@@ -142,8 +143,13 @@ bool PureDocParser::processQdocComments()
(topic == COMMAND_QMLATTACHEDPROPERTY)) {
isQmlPropertyTopic = true;
}
+ else if ((topic == COMMAND_JSPROPERTY) ||
+ (topic == COMMAND_JSPROPERTYGROUP) ||
+ (topic == COMMAND_JSATTACHEDPROPERTY)) {
+ isJsPropertyTopic = true;
+ }
}
- if (isQmlPropertyTopic && topics.size() > 1) {
+ if ((isQmlPropertyTopic || isJsPropertyTopic) && topics.size() > 1) {
qDebug() << "MULTIPLE TOPICS:" << doc.location().fileName() << doc.location().lineNo();
for (int i=0; i<topics.size(); ++i) {
qDebug() << " " << topics[i].topic << topics[i].args;
@@ -158,9 +164,9 @@ bool PureDocParser::processQdocComments()
"(e.g., '\\%1', '\\%2').")
.arg(COMMAND_MODULE).arg(COMMAND_PAGE));
}
- else if (isQmlPropertyTopic) {
+ else if (isQmlPropertyTopic || isJsPropertyTopic) {
Doc nodeDoc = doc;
- processQmlProperties(nodeDoc, nodes, docs);
+ processQmlProperties(nodeDoc, nodes, docs, isJsPropertyTopic);
}
else {
ArgList args;