diff options
author | Martin Smith <martin.smith@nokia.com> | 2011-08-11 09:42:27 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2011-08-11 09:42:27 (GMT) |
commit | a9b6b923ab870ece76891c5330fdba26ce1bf613 (patch) | |
tree | 570a53f4322015ba8805bde49fca9bb8c4578949 /tools/qdoc3/node.cpp | |
parent | cc997e664ab6cd9e6551ec8228d1585d2a46a3d2 (diff) | |
download | Qt-a9b6b923ab870ece76891c5330fdba26ce1bf613.zip Qt-a9b6b923ab870ece76891c5330fdba26ce1bf613.tar.gz Qt-a9b6b923ab870ece76891c5330fdba26ce1bf613.tar.bz2 |
qdoc3: Updates for QTBUG-20739 (no read-only for QML components)
Task-number: QTBUG-20739
Diffstat (limited to 'tools/qdoc3/node.cpp')
-rw-r--r-- | tools/qdoc3/node.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index e14b08d..f6893fb 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -305,6 +305,38 @@ QString Node::ditaXmlHref() } /*! + If this node is a QML class node, return a pointer to it. + If it is a child of a QML class node, return a pointer to + the QML class node. Otherwise, return 0; + */ +const QmlClassNode* Node::qmlClassNode() const +{ + if (isQmlNode()) { + const Node* n = this; + while (n && n->subType() != Node::QmlClass) + n = n->parent(); + if (n && n->subType() == Node::QmlClass) + return static_cast<const QmlClassNode*>(n); + } + return 0; +} + +/*! + If this node is a QML node, find its QML class node, + and return a pointer to the C++ class node from the + QML class node. That pointer will be null if the QML + class node is a component. It will be non-null if + the QML class node is a QML element. + */ +const ClassNode* Node::declarativeCppNode() const +{ + const QmlClassNode* qcn = qmlClassNode(); + if (qcn) + return qcn->classNode(); + return 0; +} + +/*! \class InnerNode */ |