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/codemarker.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/codemarker.cpp')
-rw-r--r-- | src/tools/qdoc/codemarker.cpp | 64 |
1 files changed, 55 insertions, 9 deletions
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index 6095d0d2fa..7a7ede0f20 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -381,8 +381,9 @@ QString CodeMarker::sortName(const Node *node, const QString* name) if ((node->type() == Node::QmlMethod) || (node->type() == Node::QmlSignal) || (node->type() == Node::QmlSignalHandler)) { - const FunctionNode* func = static_cast<const FunctionNode *>(node); - return QLatin1Char('E') + func->name(); + //const FunctionNode* func = static_cast<const FunctionNode *>(node); + //return QLatin1Char('E') + func->name(); + return QLatin1Char('E') + nodeName; } return QLatin1Char('B') + nodeName; @@ -518,14 +519,59 @@ bool CodeMarker::insertReimpFunc(FastSection& fs, Node* node, Status status) void CodeMarker::append(QList<Section>& sectionList, const FastSection& fs, bool includeKeys) { if (!fs.isEmpty()) { - Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember); - if (includeKeys) { - section.keys = fs.memberMap.keys(); + if (fs.classMapList_.isEmpty()) { + Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember); + if (includeKeys) { + section.keys = fs.memberMap.keys(); + } + section.members = fs.memberMap.values(); + section.reimpMembers = fs.reimpMemberMap.values(); + section.inherited = fs.inherited; + sectionList.append(section); + } + else { + Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember); + sectionList.append(section); + Section* s = §ionList[sectionList.size()-1]; + for (int i=0; i<fs.classMapList_.size(); i++) { + ClassMap* classMap = fs.classMapList_[i]; + ClassKeysNodes* ckn = new ClassKeysNodes; + ckn->first = classMap->first; + ckn->second.second = classMap->second.values(); + ckn->second.first = classMap->second.keys(); + s->classKeysNodesList_.append(ckn); + } + } + } +} + +/*! + The destructor must delete each member of the + list of QML class lists, if it is not empty; + */ +Section::~Section() +{ + if (!classKeysNodesList_.isEmpty()) { + for (int i=0; i<classKeysNodesList_.size(); i++) { + ClassKeysNodes* classKeysNodes = classKeysNodesList_[i]; + classKeysNodesList_[i] = 0; + delete classKeysNodes; + } + } +} + +/*! + The destructor must delete the QML class maps in the class + map list, if the class map list is not empty. + */ +FastSection::~FastSection() +{ + if (!classMapList_.isEmpty()) { + for (int i=0; i<classMapList_.size(); i++) { + ClassMap* classMap = classMapList_[i]; + classMapList_[i] = 0; + delete classMap; } - section.members = fs.memberMap.values(); - section.reimpMembers = fs.reimpMemberMap.values(); - section.inherited = fs.inherited; - sectionList.append(section); } } |