summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-02-03 15:13:06 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-02-03 15:13:06 (GMT)
commitacbbafc95096701ae0eb6917a5922a371cb37c69 (patch)
tree854d1963cd20f94d92c5e1d2dbc97a7d38cc3f97 /tools/qdoc3
parent7a4d0130441bae27a302e694828ec71ade9e6005 (diff)
parent14054a47230d41063a10ce8fbf7dc65c916163d7 (diff)
downloadQt-acbbafc95096701ae0eb6917a5922a371cb37c69.zip
Qt-acbbafc95096701ae0eb6917a5922a371cb37c69.tar.gz
Qt-acbbafc95096701ae0eb6917a5922a371cb37c69.tar.bz2
Merge branch 'master' into qdoc-i18n
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/cppcodeparser.cpp18
-rw-r--r--tools/qdoc3/htmlgenerator.cpp9
-rw-r--r--tools/qdoc3/node.cpp28
-rw-r--r--tools/qdoc3/node.h11
-rw-r--r--tools/qdoc3/pagegenerator.cpp7
-rw-r--r--tools/qdoc3/tree.cpp3
6 files changed, 68 insertions, 8 deletions
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 129fa7d..c8655a4 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -95,6 +95,7 @@ QT_BEGIN_NAMESPACE
#define COMMAND_QMLMETHOD Doc::alias("qmlmethod")
#define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod")
#define COMMAND_QMLDEFAULT Doc::alias("default")
+#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype")
#endif
QStringList CppCodeParser::exampleFiles;
@@ -536,7 +537,8 @@ QSet<QString> CppCodeParser::topicCommands()
<< COMMAND_QMLSIGNAL
<< COMMAND_QMLATTACHEDSIGNAL
<< COMMAND_QMLMETHOD
- << COMMAND_QMLATTACHEDMETHOD;
+ << COMMAND_QMLATTACHEDMETHOD
+ << COMMAND_QMLBASICTYPE;
#else
<< COMMAND_VARIABLE;
#endif
@@ -728,6 +730,20 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
}
return new QmlClassNode(tre->root(), names[0], classNode);
}
+ else if (command == COMMAND_QMLBASICTYPE) {
+#if 0
+ QStringList parts = arg.split(" ");
+ qDebug() << command << parts;
+ if (parts.size() > 1) {
+ FakeNode* pageNode = static_cast<FakeNode*>(tre->root()->findNode(parts[1], Node::Fake));
+ if (pageNode) {
+ qDebug() << "FOUND";
+ return new QmlBasicTypeNode(pageNode, parts[0]);
+ }
+ }
+#endif
+ return new QmlBasicTypeNode(tre->root(), arg);
+ }
else if ((command == COMMAND_QMLSIGNAL) ||
(command == COMMAND_QMLMETHOD) ||
(command == COMMAND_QMLATTACHEDSIGNAL) ||
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 21b358a..15afd7d 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1438,14 +1438,19 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
QList<Section> sections;
QList<Section>::const_iterator s;
- QString htmlTitle = fake->fullTitle();
+ QString fullTitle = fake->fullTitle();
+ QString htmlTitle = fullTitle;
if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) {
subTitleSize = SmallSubTitle;
htmlTitle += " (" + fake->subTitle() + ")";
}
+ else if (fake->subType() == Node::QmlBasicType) {
+ fullTitle = "QML Basic Type: " + fullTitle;
+ htmlTitle = fullTitle;
+ }
generateHeader(htmlTitle, fake, marker, true);
- generateTitle(fake->fullTitle(),
+ generateTitle(fullTitle,
Text() << fake->subTitle(),
subTitleSize,
fake,
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 5796ea4..4da916c 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -85,6 +85,9 @@ void Node::setDoc(const Doc& doc, bool replace)
}
/*!
+ Construct a node with the given \a type and having the
+ given \a parent and \a name. The new node is added to the
+ parent's child list.
*/
Node::Node(Type type, InnerNode *parent, const QString& name)
: typ(type),
@@ -490,6 +493,8 @@ NodeList InnerNode::overloads(const QString &funcName) const
}
/*!
+ Construct an inner node (i.e., not a leaf node) of the
+ given \a type and having the given \a parent and \a name.
*/
InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name)
: Node(type, parent, name)
@@ -547,6 +552,7 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2)
}
/*!
+ Adds the \a child to this node's child list.
*/
void InnerNode::addChild(Node *child)
{
@@ -564,7 +570,9 @@ void InnerNode::addChild(Node *child)
else {
if (child->type() == Enum)
enumChildren.append(child);
- childMap.insert(child->name(), child);
+ if (childMap.contains(child->name()))
+ qDebug() << "Duplicate child" << child->name();
+ childMap.insert(child->name(), child);
}
}
@@ -1207,7 +1215,11 @@ bool TargetNode::isInnerNode() const
bool QmlClassNode::qmlOnly = false;
/*!
- Constructor for the Qml class node.
+ Constructs a Qml class node (i.e. a Fake node with the
+ subtype QmlClass. The new node has the given \a parent
+ and \a name and is associated with the C++ class node
+ specified by \a cn which may be null if the the Qml
+ class node is not associated with a C++ class node.
*/
QmlClassNode::QmlClassNode(InnerNode *parent,
const QString& name,
@@ -1234,6 +1246,18 @@ QString QmlClassNode::fileBase() const
}
/*!
+ Constructs a Qml basic type node (i.e. a Fake node with
+ the subtype QmlBasicType. The new node has the given
+ \a parent and \a name.
+ */
+QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
+ const QString& name)
+ : FakeNode(parent, name, QmlBasicType)
+{
+ setTitle(name);
+}
+
+/*!
Constructor for the Qml property group node. \a parent is
always a QmlClassNode.
*/
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index c77fbeb..077aeb8 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -96,7 +96,8 @@ class Node
#ifdef QDOC_QML
ExternalPage,
QmlClass,
- QmlPropertyGroup
+ QmlPropertyGroup,
+ QmlBasicType
#else
ExternalPage
#endif
@@ -373,6 +374,14 @@ class QmlClassNode : public FakeNode
const ClassNode* cnode;
};
+class QmlBasicTypeNode : public FakeNode
+{
+ public:
+ QmlBasicTypeNode(InnerNode *parent,
+ const QString& name);
+ virtual ~QmlBasicTypeNode() { }
+};
+
class QmlPropGroupNode : public FakeNode
{
public:
diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp
index e637109..bc73eb0 100644
--- a/tools/qdoc3/pagegenerator.cpp
+++ b/tools/qdoc3/pagegenerator.cpp
@@ -104,7 +104,8 @@ QString PageGenerator::fileBase(const Node *node)
we prepend "qml-" to the file name of QML element doc
files.
*/
- if (p->subType() == Node::QmlClass) {
+ if ((p->subType() == Node::QmlClass) ||
+ (p->subType() == Node::QmlBasicType)) {
base.prepend("qml-");
}
#endif
@@ -209,6 +210,10 @@ void PageGenerator::generateInnerNode(const InnerNode *node,
if (fakeNode->subType() == Node::QmlPropertyGroup)
return;
#endif
+ if (fakeNode->subType() == Node::Page) {
+ if (node->count() > 0)
+ qDebug() << "PAGE" << fakeNode->title() << "HAS CHILDREN";
+ }
}
if (node->parent() != 0) {
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index d46da95..6c2502d 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -1914,7 +1914,8 @@ QString Tree::fullDocumentLocation(const Node *node) const
}
else if (node->type() == Node::Fake) {
#ifdef QDOC_QML
- if (node->subType() == Node::QmlClass)
+ if ((node->subType() == Node::QmlClass) ||
+ (node->subType() == Node::QmlBasicType))
return "qml-" + node->fileBase() + ".html";
else
#endif