diff options
author | Martin Smith <martin.smith@digia.com> | 2013-03-20 13:26:09 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-22 12:13:23 +0100 |
commit | 04770e5824cbde365e935b47bd287a9a81fff6f9 (patch) | |
tree | 0aa5143788476f1e4eec78df9246fd01c0787a49 /src/tools/qdoc/cppcodemarker.cpp | |
parent | bf3a5ccef13d568662f027be62280aba1f73bada (diff) |
qdoc: List of all members subpage redesigned
The subpage listing all the members of a QML type,
including the inherited members, was trying to use
an old format that works ok for C++ classes but is
not optimal for QML types.
The redesigned format for QML types still lists all
the members but it lists the members for each base
type in a separate list.
The members for a QML type that has been marked as
abstract are listed with the members of the type
that inherits the abstract type.
This fix does not fix QTBUG-30111, which will be
fixed in a separate commit. This means that some
links on the subpage generated by this change
will be links to a page that doesn't actually
contain any documentation for the linked member.
But it will eventually.
Task-number: QTBUG-30114
Change-Id: I8ae4227d1eaecdbc24a4ac9b8119f0ced2cdee92
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools/qdoc/cppcodemarker.cpp')
-rw-r--r-- | src/tools/qdoc/cppcodemarker.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index f0cfc18515..5af9cdf2e8 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -1258,9 +1258,24 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno append(sections,qmlattachedmethods); } else { + /* + This is where the list of all members including inherited + members is prepared. + */ + ClassMap* classMap = 0; FastSection all(qmlClassNode,QString(),QString(),"member","members"); const QmlClassNode* current = qmlClassNode; while (current != 0) { + /* + If the QML type is abstract, do not create + a new entry in the list for it. Instead, + add its members to the current entry. + */ + if (!current->isAbstract()) { + classMap = new ClassMap; + classMap->first = current; + all.classMapList_.append(classMap); + } NodeList::ConstIterator c = current->childNodes().constBegin(); while (c != current->childNodes().constEnd()) { if ((*c)->subType() == Node::QmlPropertyGroup) { @@ -1268,21 +1283,19 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno NodeList::ConstIterator p = qpgn->childNodes().constBegin(); while (p != qpgn->childNodes().constEnd()) { if ((*p)->type() == Node::QmlProperty) { - QString key = current->name() + "::" + (*p)->name(); + QString key = (*p)->name(); key = sortName(*p, &key); - if (!all.memberMap.contains(key)) { - all.memberMap.insert(key,*p); - } + all.memberMap.insert(key,*p); + classMap->second.insert(key,*p); } ++p; } } else { - QString key = current->name() + "::" + (*c)->name(); + QString key = (*c)->name(); key = sortName(*c, &key); - if (!all.memberMap.contains(key)) { - all.memberMap.insert(key,*c); - } + all.memberMap.insert(key,*c); + classMap->second.insert(key,*c); } ++c; } |