diff -r b72c6db6890b -r 5dc02b23752f tools/qdoc3/helpprojectwriter.cpp --- a/tools/qdoc3/helpprojectwriter.cpp Wed Jun 23 19:07:03 2010 +0300 +++ b/tools/qdoc3/helpprojectwriter.cpp Tue Jul 06 15:10:48 2010 +0300 @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include #include #include +#include #include "atom.h" #include "helpprojectwriter.h" @@ -117,6 +117,11 @@ typeHash["property"] = Node::Property; typeHash["variable"] = Node::Variable; typeHash["target"] = Node::Target; +#ifdef QDOC_QML + typeHash["qmlproperty"] = Node::QmlProperty; + typeHash["qmlsignal"] = Node::QmlSignal; + typeHash["qmlmethod"] = Node::QmlMethod; +#endif QHash subTypeHash; subTypeHash["example"] = Node::Example; @@ -128,6 +133,8 @@ subTypeHash["externalpage"] = Node::ExternalPage; #ifdef QDOC_QML subTypeHash["qmlclass"] = Node::QmlClass; + subTypeHash["qmlpropertygroup"] = Node::QmlPropertyGroup; + subTypeHash["qmlbasictype"] = Node::QmlBasicType; #endif QSet allSubTypes = QSet::fromList(subTypeHash.values()); @@ -177,7 +184,13 @@ { QStringList details; - if (node->parent() && !node->parent()->name().isEmpty()) { + if (node->type() == Node::QmlProperty) { + // "name" + details << node->name(); + // "id" + details << node->parent()->parent()->name()+"::"+node->name(); + } + else if (node->parent() && !node->parent()->name().isEmpty()) { // "name" if (node->type() == Node::Enum || node->type() == Node::Typedef) details << node->parent()->name()+"::"+node->name(); @@ -185,29 +198,29 @@ details << node->name(); // "id" details << node->parent()->name()+"::"+node->name(); - } else if (node->type() == Node::Fake) { + } + else if (node->type() == Node::Fake) { const FakeNode *fake = static_cast(node); -#ifdef QDOC_QML if (fake->subType() == Node::QmlClass) { details << (QmlClassNode::qmlOnly ? fake->name() : fake->fullTitle()); details << "QML." + fake->name(); - } else -#endif - { + } + else { details << fake->fullTitle(); details << fake->fullTitle(); } - } else { + } + else { details << node->name(); details << node->name(); } details << tree->fullDocumentLocation(node); - return details; } bool HelpProjectWriter::generateSection(HelpProject &project, - QXmlStreamWriter & /* writer */, const Node *node) + QXmlStreamWriter & /* writer */, + const Node *node) { if (!node->url().isEmpty()) return false; @@ -226,9 +239,10 @@ if (node->type() == Node::Fake) { const FakeNode *fake = static_cast(node); objName = fake->fullTitle(); - } else + } + else objName = tree->fullDocumentName(node); - + // Only add nodes to the set for each subproject if they match a selector. // Those that match will be listed in the table of contents. @@ -290,6 +304,9 @@ break; case Node::Property: + case Node::QmlProperty: + case Node::QmlSignal: + case Node::QmlMethod: project.keywords.append(keywordDetails(node)); break; @@ -400,7 +417,7 @@ { if (!generateSection(project, writer, node)) return; - + if (node->isInnerNode()) { const InnerNode *inner = static_cast(node); @@ -409,8 +426,23 @@ foreach (const Node *node, inner->childNodes()) { if (node->access() == Node::Private) continue; - if (node->type() == Node::Fake) - childMap[static_cast(node)->fullTitle()] = node; + if (node->type() == Node::Fake) { + /* + Don't visit QML property group nodes, + but visit their children, which are all + QML property nodes. + */ + if (node->subType() == Node::QmlPropertyGroup) { + const InnerNode* inner = static_cast(node); + foreach (const Node* n, inner->childNodes()) { + if (n->access() == Node::Private) + continue; + childMap[tree->fullDocumentName(n)] = n; + } + } + else + childMap[static_cast(node)->fullTitle()] = node; + } else { if (node->type() == Node::Function) { const FunctionNode *funcNode = static_cast(node);