summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/helpprojectwriter.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-25 22:09:36 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-25 22:09:36 (GMT)
commit11b9190a182c5f3c1055c100145b02a3975509ed (patch)
tree2c664ad92363204c320e23f9d1e6ca29505eaf2e /tools/qdoc3/helpprojectwriter.cpp
parent03686225036ebfc5cf78e3fcc66f5810a140c7d2 (diff)
parent3671dbf34940e166b747b6f8f3f5758fd486073c (diff)
downloadQt-11b9190a182c5f3c1055c100145b02a3975509ed.zip
Qt-11b9190a182c5f3c1055c100145b02a3975509ed.tar.gz
Qt-11b9190a182c5f3c1055c100145b02a3975509ed.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts: src/declarative/graphicsitems/qdeclarativeitem.cpp
Diffstat (limited to 'tools/qdoc3/helpprojectwriter.cpp')
-rw-r--r--tools/qdoc3/helpprojectwriter.cpp61
1 files changed, 47 insertions, 14 deletions
diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp
index 71810e4..edba097 100644
--- a/tools/qdoc3/helpprojectwriter.cpp
+++ b/tools/qdoc3/helpprojectwriter.cpp
@@ -41,6 +41,7 @@
#include <QHash>
#include <QMap>
+#include <qdebug.h>
#include "atom.h"
#include "helpprojectwriter.h"
@@ -116,6 +117,11 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
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<QString, Node::SubType> subTypeHash;
subTypeHash["example"] = Node::Example;
@@ -127,6 +133,8 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
subTypeHash["externalpage"] = Node::ExternalPage;
#ifdef QDOC_QML
subTypeHash["qmlclass"] = Node::QmlClass;
+ subTypeHash["qmlpropertygroup"] = Node::QmlPropertyGroup;
+ subTypeHash["qmlbasictype"] = Node::QmlBasicType;
#endif
QSet<Node::SubType> allSubTypes = QSet<Node::SubType>::fromList(subTypeHash.values());
@@ -176,7 +184,13 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
{
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();
@@ -184,29 +198,29 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
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<const FakeNode *>(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;
@@ -225,9 +239,10 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
if (node->type() == Node::Fake) {
const FakeNode *fake = static_cast<const FakeNode *>(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.
@@ -289,6 +304,9 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
break;
case Node::Property:
+ case Node::QmlProperty:
+ case Node::QmlSignal:
+ case Node::QmlMethod:
project.keywords.append(keywordDetails(node));
break;
@@ -399,7 +417,7 @@ void HelpProjectWriter::generateSections(HelpProject &project,
{
if (!generateSection(project, writer, node))
return;
-
+
if (node->isInnerNode()) {
const InnerNode *inner = static_cast<const InnerNode *>(node);
@@ -408,8 +426,23 @@ void HelpProjectWriter::generateSections(HelpProject &project,
foreach (const Node *node, inner->childNodes()) {
if (node->access() == Node::Private)
continue;
- if (node->type() == Node::Fake)
- childMap[static_cast<const FakeNode *>(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<const InnerNode*>(node);
+ foreach (const Node* n, inner->childNodes()) {
+ if (n->access() == Node::Private)
+ continue;
+ childMap[tree->fullDocumentName(n)] = n;
+ }
+ }
+ else
+ childMap[static_cast<const FakeNode *>(node)->fullTitle()] = node;
+ }
else {
if (node->type() == Node::Function) {
const FunctionNode *funcNode = static_cast<const FunctionNode *>(node);