summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-08-18 11:31:55 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-08-18 11:31:55 (GMT)
commitbc0328e334f456c789a18eb254af4427ea730187 (patch)
treefd0c0bb25cf667fb03cfb8426b9383905e6311be /tools/qdoc3
parent69e8769e2a3f44700c24437dc851ea817c16318f (diff)
downloadQt-bc0328e334f456c789a18eb254af4427ea730187.zip
Qt-bc0328e334f456c789a18eb254af4427ea730187.tar.gz
Qt-bc0328e334f456c789a18eb254af4427ea730187.tar.bz2
qdoc: Reorganized the QML elements table to be a dictionary...
...and a set of functional group pages.
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/htmlgenerator.cpp107
-rw-r--r--tools/qdoc3/node.cpp23
2 files changed, 95 insertions, 35 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 50f8b56..8215ddc 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4422,57 +4422,98 @@ bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer,
return true;
if (node->access() == Node::Private)
return false;
- if (!node->isInnerNode())
- return false;
+ QString t;
+ QString url = PageGenerator::fileName(node);
QString title;
QString rawTitle;
QString fullTitle;
- const InnerNode* inner = static_cast<const InnerNode*>(node);
-
- writer.writeStartElement("page");
+ QStringList pageWords;
QXmlStreamAttributes attributes;
- QString t;
+
+ writer.writeStartElement("page");
t.setNum(id++);
- switch (node->type()) {
- case Node::Fake:
- {
- const FakeNode* fake = static_cast<const FakeNode*>(node);
- title = fake->fullTitle();
- break;
- }
- case Node::Class:
- {
- title = node->name() + " Class Reference";
+
+ if (node->isInnerNode()) {
+ const InnerNode* inner = static_cast<const InnerNode*>(node);
+ switch (node->type()) {
+ case Node::Fake:
+ {
+ const FakeNode* fake = static_cast<const FakeNode*>(node);
+ title = fake->fullTitle();
+ pageWords << title;
+ break;
+ }
+ case Node::Class:
+ {
+ title = node->name() + " Class Reference";
+ pageWords << node->name() << "class" << "reference";
+ break;
+ }
+ case Node::Namespace:
+ {
+ rawTitle = marker->plainName(inner);
+ fullTitle = marker->plainFullName(inner);
+ title = rawTitle + " Namespace Reference";
+ pageWords << rawTitle << "namespace" << "reference";
+ break;
+ }
+ default:
+ title = node->name();
+ pageWords << title;
break;
}
- case Node::Namespace:
- {
- rawTitle = marker->plainName(inner);
- fullTitle = marker->plainFullName(inner);
- title = rawTitle + " Namespace Reference";
+
+ if (!inner->pageKeywords().isEmpty())
+ pageWords << inner->pageKeywords();
+ }
+ else {
+ switch (node->type()) {
+ case Node::Enum:
+ {
+ title = node->name() + " Enum Reference";
+ pageWords << node->name() << "enum" << "type";
+ url += "#" + node->name() + "-enum";
+ break;
+ }
+ case Node::Function:
+ {
+ title = node->name() + " Function Reference";
+ pageWords << node->name() << "function";
+ url += "#" + node->name();
+ break;
+ }
+ case Node::Property:
+ {
+ title = node->name() + " Property Reference";
+ pageWords << node->name() << "property";
+ url += "#" + node->name() + "-prop";
+ break;
+ }
+ case Node::Typedef:
+ {
+ title = node->name() + " Type Reference";
+ pageWords << node->name() << "typedef" << "type";
+ url += "#" + node->name();
+ break;
+ }
+ default:
+ title = node->name();
+ pageWords << title;
break;
}
- default:
- title = node->name();
- break;
}
+
writer.writeAttribute("id",t);
writer.writeStartElement("pageWords");
- writer.writeCharacters(title);
- if (!inner->pageKeywords().isEmpty()) {
- const QStringList& w = inner->pageKeywords();
- for (int i = 0; i < w.size(); ++i) {
- writer.writeCharacters(" ");
- writer.writeCharacters(w.at(i).toLocal8Bit().constData());
- }
- }
+ writer.writeCharacters(pageWords.join(" "));
+
writer.writeEndElement();
writer.writeStartElement("pageTitle");
writer.writeCharacters(title);
writer.writeEndElement();
writer.writeStartElement("pageUrl");
- writer.writeCharacters(PageGenerator::fileName(node));
+ writer.writeCharacters(url);
writer.writeEndElement();
writer.writeStartElement("pageType");
switch (node->pageType()) {
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 259641e..41f90d5 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -652,8 +652,14 @@ NodeList InnerNode::overloads(const QString &funcName) const
InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name)
: Node(type, parent, name)
{
- if (type == Class)
+ switch (type) {
+ case Class:
+ case Namespace:
setPageType(ApiPage);
+ break;
+ default:
+ break;
+ }
}
/*!
@@ -845,6 +851,19 @@ bool LeafNode::isInnerNode() const
LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name)
: Node(type, parent, name)
{
+ switch (type) {
+ case Enum:
+ case Function:
+ case Typedef:
+ case Variable:
+ case QmlProperty:
+ case QmlSignal:
+ case QmlMethod:
+ setPageType(ApiPage);
+ break;
+ default:
+ break;
+ }
}
/*!
@@ -1600,7 +1619,7 @@ QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent,
des(Trool_Default),
att(attached)
{
- // nothing.
+ setPageType(ApiPage);
}
/*!