summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/cppcodemarker.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/cppcodemarker.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/cppcodemarker.cpp')
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index e609e5920f..400c4808ed 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -135,7 +135,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
name = "<@name>" + name + "</@name>";
if ((style == Detailed) && !node->parent()->name().isEmpty() &&
- (node->type() != Node::Property) && !node->isQmlNode())
+ (node->type() != Node::Property) && !node->isQmlNode() && !node->isJsNode())
name.prepend(taggedNode(node->parent()) + "::");
switch (node->type()) {
@@ -307,14 +307,14 @@ QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary)
QString name = taggedQmlNode(node);
if (summary)
name = linkTag(node,name);
- else if (node->type() == Node::QmlProperty) {
+ else if (node->isQmlProperty() || node->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node);
if (pn->isAttached())
name.prepend(pn->element() + QLatin1Char('.'));
}
name = "<@name>" + name + "</@name>";
QString synopsis;
- if (node->type() == Node::QmlProperty) {
+ if (node->isQmlProperty() || node->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node);
synopsis = name + " : " + typified(pn->dataType());
}
@@ -1134,10 +1134,10 @@ QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl
++c;
continue;
}
- if ((*c)->type() == Node::QmlPropertyGroup) {
+ if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
insert(qmlproperties, *c, style, status);
}
- else if ((*c)->type() == Node::QmlProperty) {
+ else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
if (pn->isAttached())
insert(qmlattachedproperties,*c,style, status);
@@ -1145,17 +1145,17 @@ QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl
insert(qmlproperties,*c,style, status);
}
}
- else if ((*c)->type() == Node::QmlSignal) {
+ else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
if (sn->isAttached())
insert(qmlattachedsignals,*c,style, status);
else
insert(qmlsignals,*c,style, status);
}
- else if ((*c)->type() == Node::QmlSignalHandler) {
+ else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
insert(qmlsignalhandlers,*c,style, status);
}
- else if ((*c)->type() == Node::QmlMethod) {
+ else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
if (mn->isAttached())
insert(qmlattachedmethods,*c,style, status);
@@ -1199,27 +1199,27 @@ QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl
++c;
continue;
}
- if ((*c)->type() == Node::QmlPropertyGroup) {
+ if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
insert(qmlproperties,*c,style, status);
}
- else if ((*c)->type() == Node::QmlProperty) {
+ else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
if (pn->isAttached())
insert(qmlattachedproperties,*c,style, status);
else
insert(qmlproperties,*c,style, status);
}
- else if ((*c)->type() == Node::QmlSignal) {
+ else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
if (sn->isAttached())
insert(qmlattachedsignals,*c,style, status);
else
insert(qmlsignals,*c,style, status);
}
- else if ((*c)->type() == Node::QmlSignalHandler) {
+ else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
insert(qmlsignalhandlers,*c,style, status);
}
- else if ((*c)->type() == Node::QmlMethod) {
+ else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
if (mn->isAttached())
insert(qmlattachedmethods,*c,style, status);
@@ -1271,11 +1271,11 @@ QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl
}
NodeList::ConstIterator c = current->childNodes().constBegin();
while (c != current->childNodes().constEnd()) {
- if ((*c)->type() == Node::QmlPropertyGroup) {
+ if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(*c);
NodeList::ConstIterator p = qpgn->childNodes().constBegin();
while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
+ if ((*p)->isQmlProperty() || (*c)->isJsProperty()) {
QString key = (*p)->name();
key = sortName(*p, &key);
all.memberMap.insert(key,*p);