diff options
| author | Martin Smith <[email protected]> | 2013-02-12 09:40:02 +0100 |
|---|---|---|
| committer | The Qt Project <[email protected]> | 2013-02-13 10:11:48 +0100 |
| commit | cd84491aad703f7b983a3d61277a27998e53396a (patch) | |
| tree | 100eea8279ac95a47a9625fdd6c9951425137561 /src/tools/qdoc/qdocdatabase.cpp | |
| parent | d1fe252d6a5c62b702620fc7f0b4b6b05fcfe5e6 (diff) | |
qdoc: inherited members do not show up for QML components
This was a regression bug owing to a big qdoc cleanup
for Qt5. But the way QML inheritance had been handled
was not a good design, so it has been changed here.
When a .qml file is parsed by qdoc, the base type of
the QML component is detected, and its name is stored
in qdoc's tree node for the component. After qdoc has
parsed all the QML files, it traverses the tree, and
for each QML component that has a base type name but
no base type node pointer yet, it searches the tree
for the base type node and stores the pointer to
the node in the node for the components. Then when
the output generator generates the doc page for the
component, it has access to all the inherited members
in the base type.
Task-number: QTBUG-29569
Change-Id: Ib4958d05f55fa48a572f8ca51ffd57712f29bbc7
Reviewed-by: J-P Nurmi <[email protected]>
Reviewed-by: Topi Reiniƶ <[email protected]>
Reviewed-by: Martin Smith <[email protected]>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.cpp')
| -rw-r--r-- | src/tools/qdoc/qdocdatabase.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index 982df5bbc34..4208d529c83 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -623,6 +623,7 @@ const NodeMultiMap& QDocDatabase::getSinceMap(const QString& key) const to generating documentation. */ void QDocDatabase::resolveIssues() { + resolveQmlInheritance(treeRoot()); resolveTargets(treeRoot()); tree_->resolveCppToQmlLinks(); } @@ -822,6 +823,35 @@ QString QDocDatabase::findTarget(const QString& target, const Node* node) const } /*! + For each QML Type node in the tree beginning at \a root, + if it has a QML base type name but its QML base type node + pointer is 0, use the QML base type name to look up the + base type node. If the node is found in the tree, set the + node's QML base type node pointer. + */ +void QDocDatabase::resolveQmlInheritance(InnerNode* root) +{ + // Dop we need recursion? + foreach (Node* child, root->childNodes()) { + if (child->type() == Node::Document && child->subType() == Node::QmlClass) { + QmlClassNode* qcn = static_cast<QmlClassNode*>(child); + if ((qcn->qmlBaseNode() == 0) && !qcn->qmlBaseName().isEmpty()) { + QmlClassNode* bqcn = findQmlType(QString(), qcn->qmlBaseName()); + if (bqcn) { + qcn->setQmlBaseNode(bqcn); + } +#if 0 + else { + qDebug() << "Unable to resolve QML base type:" << qcn->qmlBaseName() + << "for QML type:" << qcn->name(); + } +#endif + } + } + } +} + +/*! */ void QDocDatabase::resolveTargets(InnerNode* root) { |
