summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodemarker.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2018-04-25 10:40:25 +0200
committerMartin Smith <martin.smith@qt.io>2018-06-01 12:14:26 +0000
commit8ad79b032432be398f8f2a8107131ba19eff7ff4 (patch)
tree311f5290f84b48ec6359c96ba1b00bb6c906f7bd /src/qdoc/cppcodemarker.cpp
parent03b8f9d935ec0c4227c02fee1b73db037cc1932a (diff)
downloadqttools-8ad79b032432be398f8f2a8107131ba19eff7ff4.tar.gz
qdoc: Refactor section construction
qdoc outputs a standard list of sections for C++ classes, namespaces, header files, etc, and for QML types. The code for constructing the lists of section data structures was include in the CodeMarker class hierarchy, but it should not have been located there because it doesn't have anything to do with documentation markup. The result was that the CodeMarker classes (CodeMarker & CppCodeMarker) contained many member functions that should have been isolated in separate classes. This update creates those separate classes and refactors CodeMarker and CppCodeMarker by removing the classes used for creating the lists of sections into a separate Sections class. This refactoring not only makes the code cleaner, it also enables implementation of the custom sections idea described in QTBUG-45725. There is a lot more work to be done for this task. Change-Id: I950a78aa31c6b5f206854efa16363b992e9bfea5 Task-number: QTBUG-45725 Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/cppcodemarker.cpp')
-rw-r--r--src/qdoc/cppcodemarker.cpp687
1 files changed, 11 insertions, 676 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp
index e1a5040dd..8b334736f 100644
--- a/src/qdoc/cppcodemarker.cpp
+++ b/src/qdoc/cppcodemarker.cpp
@@ -30,9 +30,7 @@
cppcodemarker.cpp
*/
-#include "atom.h"
#include "cppcodemarker.h"
-#include "node.h"
#include "text.h"
#include "tree.h"
#include <qdebug.h>
@@ -113,7 +111,7 @@ QString CppCodeMarker::markedUpCode(const QString &code,
QString CppCodeMarker::markedUpSynopsis(const Node *node,
const Node * /* relative */,
- SynopsisStyle style)
+ Sections::Style style)
{
const int MaxEnumValues = 6;
const FunctionNode *func;
@@ -126,11 +124,11 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
QString name;
name = taggedNode(node);
- if (style != Detailed)
+ if (style != Sections::Detailed)
name = linkTag(node, name);
name = "<@name>" + name + "</@name>";
- if ((style == Detailed) && !node->parent()->name().isEmpty() &&
+ if ((style == Sections::Detailed) && !node->parent()->name().isEmpty() &&
(node->type() != Node::Property) && !node->isQmlNode() && !node->isJsNode())
name.prepend(taggedNode(node->parent()) + "::");
@@ -147,7 +145,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
case Node::QmlMethod:
func = (const FunctionNode *) node;
- if (style != Subpage && !func->returnType().isEmpty())
+ if (style != Sections::Subpage && !func->returnType().isEmpty())
synopsis = typified(func->returnType(), true);
synopsis += name;
if (!func->isMacroWithoutParams()) {
@@ -161,9 +159,9 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
if (hasName)
synopsis += typified((*p).dataType(), true);
const QString &paramName = hasName ? (*p).name() : (*p).dataType();
- if (style != Subpage || !hasName)
+ if (style != Sections::Subpage || !hasName)
synopsis += "<@param>" + protect(paramName) + "</@param>";
- if (style != Subpage && !(*p).defaultValue().isEmpty())
+ if (style != Sections::Subpage && !(*p).defaultValue().isEmpty())
synopsis += " = " + protect((*p).defaultValue());
++p;
}
@@ -173,7 +171,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
if (func->isConst())
synopsis += " const";
- if (style == Summary || style == Accessors) {
+ if (style == Sections::Summary || style == Sections::Accessors) {
if (!func->isNonvirtual())
synopsis.prepend("virtual ");
if (func->isFinal())
@@ -191,7 +189,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
else if (func->isRefRef())
synopsis.append(" &&");
}
- else if (style == Subpage) {
+ else if (style == Sections::Subpage) {
if (!func->returnType().isEmpty() && func->returnType() != "void")
synopsis += " : " + typified(func->returnType());
}
@@ -239,7 +237,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
case Node::Enum:
enume = static_cast<const EnumNode *>(node);
synopsis = "enum " + name;
- if (style == Summary) {
+ if (style == Sections::Summary) {
synopsis += " { ";
QStringList documentedItems = enume->doc().enumItemNames();
@@ -290,7 +288,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
break;
case Node::Variable:
variable = static_cast<const VariableNode *>(node);
- if (style == Subpage) {
+ if (style == Sections::Subpage) {
synopsis = name + " : " + typified(variable->dataType());
}
else {
@@ -302,7 +300,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
synopsis = name;
}
- if (style == Summary) {
+ if (style == Sections::Summary) {
if (node->status() == Node::Preliminary) {
extra += "(preliminary) ";
}
@@ -455,434 +453,6 @@ QString CppCodeMarker::functionEndRegExp(const QString& /* funcName */)
return "^\\}$";
}
-QList<Section> CppCodeMarker::sections(const Aggregate *aggregate,
- SynopsisStyle style,
- Status status)
-{
- QList<Section> sections;
-
- bool documentAll = true;
- if (aggregate->isClass()) {
- if (aggregate->parent() && !aggregate->name().isEmpty() && !aggregate->hasDoc())
- documentAll = false;
- if (style == Summary) {
- FastSection privateFunctions(aggregate,
- "Private Functions",
- QString(),
- "private function",
- "private functions");
- FastSection privateSlots(aggregate, "Private Slots", QString(), "private slot", "private slots");
- FastSection privateTypes(aggregate, "Private Types", QString(), "private type", "private types");
- FastSection protectedFunctions(aggregate,
- "Protected Functions",
- QString(),
- "protected function",
- "protected functions");
- FastSection protectedSlots(aggregate,
- "Protected Slots",
- QString(),
- "protected slot",
- "protected slots");
- FastSection protectedTypes(aggregate,
- "Protected Types",
- QString(),
- "protected type",
- "protected types");
- FastSection protectedVariables(aggregate,
- "Protected Variables",
- QString(),
- "protected type",
- "protected variables");
- FastSection publicFunctions(aggregate,
- "Public Functions",
- QString(),
- "public function",
- "public functions");
- FastSection publicSignals(aggregate, "Signals", QString(), "signal", "signals");
- FastSection publicSlots(aggregate, "Public Slots", QString(), "public slot", "public slots");
- FastSection publicTypes(aggregate, "Public Types", QString(), "public type", "public types");
- FastSection publicVariables(aggregate,
- "Public Variables",
- QString(),
- "public variable",
- "public variables");
- FastSection properties(aggregate, "Properties", QString(), "property", "properties");
- FastSection relatedNonMembers(aggregate,
- "Related Non-Members",
- QString(),
- "related non-member",
- "related non-members");
- FastSection staticPrivateMembers(aggregate,
- "Static Private Members",
- QString(),
- "static private member",
- "static private members");
- FastSection staticProtectedMembers(aggregate,
- "Static Protected Members",
- QString(),
- "static protected member",
- "static protected members");
- FastSection staticPublicMembers(aggregate,
- "Static Public Members",
- QString(),
- "static public member",
- "static public members");
- FastSection macros(aggregate, "Macros", QString(), "macro", "macros");
-
- NodeList::ConstIterator r = aggregate->relatedNodes().constBegin();
- while (r != aggregate->relatedNodes().constEnd()) {
- if ((*r)->isFunction()) {
- FunctionNode *func = static_cast<FunctionNode *>(*r);
- if (func->isMacro())
- insert(macros, *r, style, status);
- else
- insert(relatedNonMembers, *r, style, status);
- }
- else {
- insert(relatedNonMembers, *r, style, status);
- }
- ++r;
- }
-
- QStack<const Aggregate *> stack;
- stack.push(aggregate);
- while (!stack.isEmpty()) {
- const Aggregate* ancestor = stack.pop();
-
- NodeList::ConstIterator c = ancestor->childNodes().constBegin();
- while (c != ancestor->childNodes().constEnd()) {
- if (!documentAll && !(*c)->hasDoc()) {
- ++c;
- continue;
- }
- bool isSlot = false;
- bool isSignal = false;
- bool isStatic = false;
- if ((*c)->isFunction()) {
- const FunctionNode *func = (const FunctionNode *) *c;
- isSlot = (func->isSlot());
- isSignal = (func->isSignal());
- isStatic = func->isStatic();
- if (func->hasAssociatedProperties() && !func->hasActiveAssociatedProperty()) {
- ++c;
- continue;
- }
- else if (func->isIgnored()) {
- ++c;
- continue;
- }
- }
- else if ((*c)->isVariable()) {
- const VariableNode *var = static_cast<const VariableNode *>(*c);
- isStatic = var->isStatic();
- }
- else if ((*c)->isTypedef()) {
- if ((*c)->name() == QLatin1String("QtGadgetHelper")) {
- ++c;
- continue;
- }
- }
-
- switch ((*c)->access()) {
- case Node::Public:
- if (isSlot) {
- insert(publicSlots, *c, style, status);
- }
- else if (isSignal) {
- insert(publicSignals, *c, style, status);
- }
- else if (isStatic) {
- if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
- insert(staticPublicMembers,*c,style,status);
- }
- else if ((*c)->type() == Node::Property) {
- insert(properties, *c, style, status);
- }
- else if ((*c)->type() == Node::Variable) {
- if (!(*c)->doc().isEmpty())
- insert(publicVariables, *c, style, status);
- }
- else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(publicFunctions,*c,status)) {
- insert(publicFunctions, *c, style, status);
- }
- }
- else if ((*c)->type() != Node::SharedComment) {
- insert(publicTypes, *c, style, status);
- }
- break;
- case Node::Protected:
- if (isSlot) {
- insert(protectedSlots, *c, style, status);
- }
- else if (isStatic) {
- if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
- insert(staticProtectedMembers,*c,style,status);
- }
- else if ((*c)->type() == Node::Variable) {
- if (!(*c)->doc().isEmpty())
- insert(protectedVariables,*c,style,status);
- }
- else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(protectedFunctions,*c,status)) {
- insert(protectedFunctions, *c, style, status);
- }
- }
- else {
- insert(protectedTypes, *c, style, status);
- }
- break;
- case Node::Private:
- if (isSlot) {
- insert(privateSlots, *c, style, status);
- }
- else if (isStatic) {
- if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
- insert(staticPrivateMembers,*c,style,status);
- }
- else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(privateFunctions,*c,status)) {
- insert(privateFunctions, *c, style, status);
- }
- }
- else {
- insert(privateTypes,*c,style,status);
- }
- }
- ++c;
- }
-
- if (ancestor->isClass()) {
- const ClassNode* cn = static_cast<const ClassNode*>(ancestor);
- QList<RelatedClass>::ConstIterator r = cn->baseClasses().constBegin();
- while (r != cn->baseClasses().constEnd()) {
- if ((*r).node_)
- stack.prepend((*r).node_);
- ++r;
- }
- }
- }
- append(sections, publicTypes);
- append(sections, properties);
- append(sections, publicFunctions);
- append(sections, publicSlots);
- append(sections, publicSignals);
- append(sections, publicVariables);
- append(sections, staticPublicMembers);
- append(sections, protectedTypes);
- append(sections, protectedFunctions);
- append(sections, protectedSlots);
- append(sections, protectedVariables);
- append(sections, staticProtectedMembers);
- append(sections, privateTypes);
- append(sections, privateFunctions);
- append(sections, privateSlots);
- append(sections, staticPrivateMembers);
- append(sections, relatedNonMembers);
- append(sections, macros);
- }
- else if (style == Detailed) {
- FastSection memberFunctions(aggregate,"Member Function Documentation","func","member","members");
- FastSection memberTypes(aggregate,"Member Type Documentation","types","member","members");
- FastSection memberVariables(aggregate,"Member Variable Documentation","vars","member","members");
- FastSection properties(aggregate,"Property Documentation","prop","member","members");
- FastSection relatedNonMembers(aggregate,"Related Non-Members","relnonmem","member","members");
- FastSection macros(aggregate,"Macro Documentation","macros","member","members");
-
- NodeList::ConstIterator r = aggregate->relatedNodes().constBegin();
- while (r != aggregate->relatedNodes().constEnd()) {
- if ((*r)->isFunction()) {
- FunctionNode *func = static_cast<FunctionNode *>(*r);
- if (func->isMacro())
- insert(macros, *r, style, status);
- else if (!func->isSharingComment())
- insert(relatedNonMembers, *r, style, status);
- }
- else {
- insert(relatedNonMembers, *r, style, status);
- }
- ++r;
- }
-
- NodeList::ConstIterator c = aggregate->childNodes().constBegin();
- while (c != aggregate->childNodes().constEnd()) {
- if ((*c)->isSharingComment()) {
- // do nothing
- } else if (!documentAll && !(*c)->hasDoc()) {
- ++c;
- continue;
- } else if ((*c)->isEnumType() || (*c)->isTypedef()) {
- if ((*c)->name() == QLatin1String("QtGadgetHelper")) {
- ++c;
- continue;
- }
- insert(memberTypes, *c, style, status);
- } else if ((*c)->isProperty()) {
- insert(properties, *c, style, status);
- } else if ((*c)->isVariable()) {
- if (!(*c)->doc().isEmpty())
- insert(memberVariables, *c, style, status);
- } else if ((*c)->isFunction()) {
- FunctionNode *function = static_cast<FunctionNode *>(*c);
- if (function->isIgnored()) {
- ++c;
- continue;
- }
- if (!function->isSharingComment()) {
- if (!function->hasAssociatedProperties() || !function->doc().isEmpty())
- insert(memberFunctions, function, style, status);
- }
- } else if ((*c)->isSharedCommentNode()) {
- SharedCommentNode *scn = static_cast<SharedCommentNode *>(*c);
- if (!scn->doc().isEmpty())
- insert(memberFunctions, scn, style, status);
- }
- ++c;
- }
-
- append(sections, memberTypes);
- append(sections, properties);
- append(sections, memberFunctions);
- append(sections, memberVariables);
- append(sections, relatedNonMembers);
- append(sections, macros);
- }
- else {
- FastSection all(aggregate,QString(),QString(),"member","members");
-
- QStack<const Aggregate*> stack;
- stack.push(aggregate);
-
- while (!stack.isEmpty()) {
- const Aggregate* ancestor = stack.pop();
- NodeList::ConstIterator c = ancestor->childNodes().constBegin();
- while (c != ancestor->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private && (*c)->type() != Node::Property)
- insert(all, *c, style, status);
- ++c;
- }
-
- if (ancestor->isClass()) {
- const ClassNode* cn = static_cast<const ClassNode*>(ancestor);
- QList<RelatedClass>::ConstIterator r = cn->baseClasses().constBegin();
- while (r != cn->baseClasses().constEnd()) {
- if ((*r).node_)
- stack.prepend((*r).node_);
- ++r;
- }
- }
- }
- append(sections, all);
- }
- } else if (style == Summary || style == Detailed) {
- FastSection namespaces(aggregate,
- "Namespaces",
- style == Detailed ? "nmspace" : QString(),
- "namespace",
- "namespaces");
- FastSection classes(aggregate,
- "Classes",
- style == Detailed ? "classes" : QString(),
- "class",
- "classes");
- FastSection types(aggregate,
- style == Summary ? "Types" : "Type Documentation",
- style == Detailed ? "types" : QString(),
- "type",
- "types");
- FastSection variables(aggregate,
- style == Summary ? "Variables" : "Variable Documentation",
- style == Detailed ? "vars" : QString(),
- "variable",
- "variables");
- FastSection staticVariables(aggregate,
- "Static Variables",
- QString(),
- "static variable",
- "static variables");
- FastSection functions(aggregate,
- style == Summary ?
- "Functions" : "Function Documentation",
- style == Detailed ? "func" : QString(),
- "function",
- "functions");
- FastSection macros(aggregate,
- style == Summary ?
- "Macros" : "Macro Documentation",
- style == Detailed ? "macros" : QString(),
- "macro",
- "macros");
-
- NodeList nodeList = aggregate->childNodes();
- nodeList += aggregate->relatedNodes();
- if (aggregate->isNamespace()) {
- const NamespaceNode* ns = static_cast<const NamespaceNode*>(aggregate);
- if (!ns->hasDoc())
- documentAll = false;
- if (style == Summary) {
- if (!ns->orphans().isEmpty())
- nodeList += ns->orphans();
- }
- }
- NodeList::ConstIterator n = nodeList.constBegin();
- while (n != nodeList.constEnd()) {
- if (documentAll || (*n)->hasDoc()) {
- switch ((*n)->type()) {
- case Node::Namespace:
- insert(namespaces, *n, style, status);
- break;
- case Node::Class:
- insert(classes, *n, style, status);
- break;
- case Node::Enum:
- case Node::Typedef:
- insert(types, *n, style, status);
- break;
- case Node::Function:
- {
- FunctionNode *func = static_cast<FunctionNode *>(*n);
- if (func->isMacro())
- insert(macros, *n, style, status);
- else
- insert(functions, *n, style, status);
- }
- break;
- case Node::Variable:
- {
- const VariableNode* var = static_cast<const VariableNode*>(*n);
- if (!var->doc().isEmpty()) {
- if (var->isStatic())
- insert(staticVariables,*n,style,status);
- else
- insert(variables, *n, style, status);
- }
- }
- break;
- case Node::SharedComment:
- {
- SharedCommentNode *scn = static_cast<SharedCommentNode *>(*n);
- if (!scn->doc().isEmpty())
- insert(functions, scn, style, status);
- }
- break;
- default:
- break;
- }
- }
- ++n;
- }
- append(sections, namespaces);
- append(sections, classes);
- append(sections, types);
- append(sections, variables);
- append(sections, staticVariables);
- append(sections, functions);
- append(sections, macros);
- }
-
- return sections;
-}
-
/*
@char
@class
@@ -1148,239 +718,4 @@ QString CppCodeMarker::addMarkUp(const QString &in,
return out;
}
-/*!
- This function is for documenting QML properties. It returns
- the list of documentation sections for the children of the
- \a aggregate.
- */
-QList<Section> CppCodeMarker::qmlSections(Aggregate* aggregate, SynopsisStyle style, Status status)
-{
- QList<Section> sections;
- if (aggregate) {
- if (style == Summary) {
- FastSection qmlproperties(aggregate,
- "Properties",
- QString(),
- "property",
- "properties");
- FastSection qmlattachedproperties(aggregate,
- "Attached Properties",
- QString(),
- "attached property",
- "attached properties");
- FastSection qmlsignals(aggregate,
- "Signals",
- QString(),
- "signal",
- "signals");
- FastSection qmlsignalhandlers(aggregate,
- "Signal Handlers",
- QString(),
- "signal handler",
- "signal handlers");
- FastSection qmlattachedsignals(aggregate,
- "Attached Signals",
- QString(),
- "attached signal",
- "attached signals");
- FastSection qmlmethods(aggregate,
- "Methods",
- QString(),
- "method",
- "methods");
- FastSection qmlattachedmethods(aggregate,
- "Attached Methods",
- QString(),
- "attached method",
- "attached methods");
-
- Aggregate* qcn = aggregate;
- while (qcn != 0) {
- NodeList::ConstIterator c = qcn->childNodes().constBegin();
- while (c != qcn->childNodes().constEnd()) {
- if ((*c)->status() == Node::Internal) {
- ++c;
- continue;
- }
- if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
- insert(qmlproperties, *c, style, status);
- }
- else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
- if (pn->isAttached())
- insert(qmlattachedproperties,*c,style, status);
- else {
- insert(qmlproperties,*c,style, status);
- }
- }
- else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
- const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
- if (sn->isAttached())
- insert(qmlattachedsignals,*c,style, status);
- else
- insert(qmlsignals,*c,style, status);
- }
- else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
- insert(qmlsignalhandlers,*c,style, status);
- }
- else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
- const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
- if (mn->isAttached())
- insert(qmlattachedmethods,*c,style, status);
- else
- insert(qmlmethods,*c,style, status);
- }
- ++c;
- }
- if (qcn->qmlBaseNode() != 0) {
- qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
- if (!qcn->isAbstract())
- qcn = 0;
- }
- else
- qcn = 0;
- }
- append(sections,qmlproperties);
- append(sections,qmlattachedproperties);
- append(sections,qmlsignals);
- append(sections,qmlsignalhandlers);
- append(sections,qmlattachedsignals);
- append(sections,qmlmethods);
- append(sections,qmlattachedmethods);
- }
- else if (style == Detailed) {
- FastSection qmlproperties(aggregate, "Property Documentation","qmlprop","member","members");
- FastSection qmlattachedproperties(aggregate,"Attached Property Documentation","qmlattprop",
- "member","members");
- FastSection qmlsignals(aggregate,"Signal Documentation","qmlsig","signal","signals");
- FastSection qmlsignalhandlers(aggregate,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers");
- FastSection qmlattachedsignals(aggregate,"Attached Signal Documentation","qmlattsig",
- "signal","signals");
- FastSection qmlmethods(aggregate,"Method Documentation","qmlmeth","member","members");
- FastSection qmlattachedmethods(aggregate,"Attached Method Documentation","qmlattmeth",
- "member","members");
- Aggregate* qcn = aggregate;
- while (qcn != 0) {
- NodeList::ConstIterator c = qcn->childNodes().constBegin();
- while (c != qcn->childNodes().constEnd()) {
- if ((*c)->status() == Node::Internal) {
- ++c;
- continue;
- }
- if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
- insert(qmlproperties,*c,style, status);
- }
- else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
- if (pn->isAttached())
- insert(qmlattachedproperties,*c,style, status);
- else
- insert(qmlproperties,*c,style, status);
- }
- else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
- const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
- if (sn->isAttached())
- insert(qmlattachedsignals,*c,style, status);
- else
- insert(qmlsignals,*c,style, status);
- }
- else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
- insert(qmlsignalhandlers,*c,style, status);
- }
- else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
- const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
- if (mn->isAttached())
- insert(qmlattachedmethods,*c,style, status);
- else
- insert(qmlmethods,*c,style, status);
- }
- ++c;
- }
- if (qcn->qmlBaseNode() != 0) {
- qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
- if (!qcn->isAbstract())
- qcn = 0;
- }
- else
- qcn = 0;
- }
- append(sections,qmlproperties);
- append(sections,qmlattachedproperties);
- append(sections,qmlsignals);
- append(sections,qmlsignalhandlers);
- append(sections,qmlattachedsignals);
- append(sections,qmlmethods);
- append(sections,qmlattachedmethods);
- }
- else {
- /*
- This is where the list of all members including inherited
- members is prepared.
- */
- ClassMap* classMap = 0;
- FastSection all(aggregate,QString(),QString(),"member","members");
- Aggregate* current = aggregate;
- 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.
-
- However, if the first class is abstract,
- there is no current entry. In that case,
- create a new entry in the list anyway.
- I'm not sure that is correct, but it at
- least can prevent a crash.
- */
- if (!current->isAbstract() || !classMap) {
- classMap = new ClassMap;
- classMap->first = static_cast<const QmlTypeNode*>(current);
- all.classMapList_.append(classMap);
- }
- NodeList::ConstIterator c = current->childNodes().constBegin();
- while (c != current->childNodes().constEnd()) {
- if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
- const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(*c);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->isQmlProperty() || (*c)->isJsProperty()) {
- QString key = (*p)->name();
- key = sortName(*p, &key);
- all.memberMap.insert(key,*p);
- classMap->second.insert(key,*p);
- }
- ++p;
- }
- }
- else {
- QString key = (*c)->name();
- key = sortName(*c, &key);
- all.memberMap.insert(key,*c);
- classMap->second.insert(key,*c);
- }
- ++c;
- }
- if (current->qmlBaseNode() == current) {
- qDebug() << "qdoc internal error: circular type definition."
- << "QML type" << current->name()
- << "can't be its own base type";
- break;
- }
- current = current->qmlBaseNode();
- while (current) {
- if (current->isAbstract())
- break;
- if (current->isInternal())
- current = current->qmlBaseNode();
- else
- break;
- }
- }
- append(sections, all, true);
- }
- }
-
- return sections;
-}
-
QT_END_NAMESPACE