From 04770e5824cbde365e935b47bd287a9a81fff6f9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 Mar 2013 13:26:09 +0100 Subject: 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 --- src/tools/qdoc/cppcodemarker.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src/tools/qdoc/cppcodemarker.cpp') 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
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
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; } -- cgit v1.2.3