diff options
| author | Martin Smith <[email protected]> | 2014-05-23 13:26:36 +0200 |
|---|---|---|
| committer | The Qt Project <[email protected]> | 2014-06-01 13:40:53 +0200 |
| commit | 46959875cf7ddeb9bbcee883e4bfaef63992b870 (patch) | |
| tree | 727c786536dbd21b28eaa8fcaf429259c97f6dc1 /src/tools/qdoc/qmlvisitor.cpp | |
| parent | bb794270ec6cffb5f95bd7d18056b9e7bede7baa (diff) | |
qdoc: Give documenter more control of linking
This update is preparation for implementing the actual task
described in the bug. To implement it required converting
the QML type node and the QML basic type node to be first
order tree nodes instead of subtypes of the documentation
node. This cleans up a lot of messy logic in some places.
It was also necessary to split the getLink() function in the
html output generator into two functions, one still called
getLink(), which handles the \l command, and one called
qetAutoLink() which is called for generating auto links.
This should make qdoc run faster.
The basic infrastructure was also added for parsing the
string in the square brackets for the \l command.
There will be a further update to complete this task.
Note that some autolinks might not be generated due to
this change. I haven't seen any yet, but I believe there
will be some. This can be fixed later, if it is a problem.
Task-number: QTBUG-39221
Change-Id: I8135229984398408205ba901b9ef95ceac74683c
Reviewed-by: Topi Reiniƶ <[email protected]>
Diffstat (limited to 'src/tools/qdoc/qmlvisitor.cpp')
| -rw-r--r-- | src/tools/qdoc/qmlvisitor.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index d16fdfa5d47..2ef751e9bc7 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -365,7 +365,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, QString command = *i; ArgList args = doc.metaCommandArgs(command); if (command == COMMAND_QMLABSTRACT) { - if ((node->type() == Node::Document) && (node->subType() == Node::QmlClass)) { + if (node->isQmlType()) { node->setAbstract(true); } } @@ -378,7 +378,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, else if (command == COMMAND_QMLINHERITS) { if (node->name() == args[0].first) doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first)); - else if (node->subType() == Node::QmlClass) { + else if (node->isQmlType()) { QmlClassNode *qmlClass = static_cast<QmlClassNode*>(node); qmlClass->setQmlBaseName(args[0].first); QmlClassNode::addInheritedBy(args[0].first,node); @@ -541,7 +541,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) switch (member->type) { case QQmlJS::AST::UiPublicMember::Signal: { - if (current->type() == Node::Document) { + if (current->isQmlType()) { QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current); if (qmlClass) { @@ -564,7 +564,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) { QString type = member->memberType.toString(); QString name = member->name.toString(); - if (current->type() == Node::Document) { + if (current->isQmlType()) { QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current); if (qmlClass) { QString name = member->name.toString(); @@ -608,7 +608,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd) if (nestingLevel > 1) { return true; } - if (current->type() == Node::Document) { + if (current->isQmlType()) { QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current); if (qmlClass) { QString name = fd->name.toString(); @@ -661,7 +661,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* ) if (nestingLevel > 1) { return true; } - if (current->type() == Node::Document) { + if (current->isQmlType()) { QString handler = sb->qualifiedId->name.toString(); if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) { QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current); |
