summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/node.cpp
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-11-05 13:09:16 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-11-11 12:47:34 (GMT)
commit385ef0b086d0736d1dd8ef03ced73c73e61dcb43 (patch)
tree98643160d26b38de4d491a1952f4722c64ffd978 /tools/qdoc3/node.cpp
parent3a492b3bcd3898335dd36b46906a5b9cce5120f3 (diff)
downloadQt-385ef0b086d0736d1dd8ef03ced73c73e61dcb43.zip
Qt-385ef0b086d0736d1dd8ef03ced73c73e61dcb43.tar.gz
Qt-385ef0b086d0736d1dd8ef03ced73c73e61dcb43.tar.bz2
qdoc3: Fixed a linking problem for qml methods.
Note the Invalid Syntax errors for some uses of \qmlmethod and \qmlsignal. A syntactically correct signature is now required as the argument.
Diffstat (limited to 'tools/qdoc3/node.cpp')
-rw-r--r--tools/qdoc3/node.cpp92
1 files changed, 65 insertions, 27 deletions
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index ecb4a44..1217042 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -218,6 +218,7 @@ Node *InnerNode::findNode(const QString& name, Type type)
}
/*!
+ Find the function node in this node for the function named \a name.
*/
FunctionNode *InnerNode::findFunctionNode(const QString& name)
{
@@ -225,6 +226,7 @@ FunctionNode *InnerNode::findFunctionNode(const QString& name)
}
/*!
+ Find the function node in this node that has the same name as \a clone.
*/
FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone)
{
@@ -248,6 +250,34 @@ FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone)
}
/*!
+ Returns the list of keys from the primary function map.
+ */
+QStringList InnerNode::primaryKeys()
+{
+ QStringList t;
+ QMap<QString, Node*>::iterator i = primaryFunctionMap.begin();
+ while (i != primaryFunctionMap.end()) {
+ t.append(i.key());
+ ++i;
+ }
+ return t;
+}
+
+/*!
+ Returns the list of keys from the secondary function map.
+ */
+QStringList InnerNode::secondaryKeys()
+{
+ QStringList t;
+ QMap<QString, NodeList>::iterator i = secondaryFunctionMap.begin();
+ while (i != secondaryFunctionMap.end()) {
+ t.append(i.key());
+ ++i;
+ }
+ return t;
+}
+
+/*!
*/
void InnerNode::setOverload(const FunctionNode *func, bool overlode)
{
@@ -392,6 +422,7 @@ const Node *InnerNode::findNode(const QString& name, Type type) const
}
/*!
+ Find the function node in this node that has the given \a name.
*/
const FunctionNode *InnerNode::findFunctionNode(const QString& name) const
{
@@ -400,9 +431,9 @@ const FunctionNode *InnerNode::findFunctionNode(const QString& name) const
}
/*!
+ Find the function node in this node that has the same name as \a clone.
*/
-const FunctionNode *InnerNode::findFunctionNode(
- const FunctionNode *clone) const
+const FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const
{
InnerNode *that = (InnerNode *) this;
return that->findFunctionNode(clone);
@@ -520,7 +551,7 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2)
void InnerNode::addChild(Node *child)
{
children.append(child);
- if (child->type() == Function) {
+ if ((child->type() == Function) || (child->type() == QmlMethod)) {
FunctionNode *func = (FunctionNode *) child;
if (!primaryFunctionMap.contains(func->name())) {
primaryFunctionMap.insert(func->name(), func);
@@ -896,11 +927,40 @@ QString Parameter::reconstruct(bool value) const
*/
/*!
+ Construct a function node for a C++ function. It's parent
+ is \a parent, and it's name is \a name.
*/
FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
- : LeafNode(Function, parent, name), met(Plain), vir(NonVirtual),
- con(false), sta(false), ove(false), rf(0), ap(0)
+ : LeafNode(Function, parent, name),
+ met(Plain),
+ vir(NonVirtual),
+ con(false),
+ sta(false),
+ ove(false),
+ att(false),
+ rf(0),
+ ap(0)
+{
+ // nothing.
+}
+
+/*!
+ Construct a function node for a QML method or signal, specified
+ by \a type. It's parent is \a parent, and it's name is \a name.
+ If \a attached is true, it is an attached method or signal.
+ */
+FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached)
+ : LeafNode(type, parent, name),
+ met(Plain),
+ vir(NonVirtual),
+ con(false),
+ sta(false),
+ ove(false),
+ att(attached),
+ rf(0),
+ ap(0)
{
+ // nothing.
}
/*!
@@ -1208,28 +1268,6 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue)
return defaultValue;
}
}
-
-/*!
- Constructor for the QML signal node.
- */
-QmlSignalNode::QmlSignalNode(QmlClassNode *parent,
- const QString& name,
- bool attached)
- : LeafNode(QmlSignal, parent, name), att(attached)
-{
- // nothing.
-}
-
-/*!
- Constructor for the QML method node.
- */
-QmlMethodNode::QmlMethodNode(QmlClassNode *parent,
- const QString& name,
- bool attached)
- : LeafNode(QmlMethod, parent, name), att(attached)
-{
- // nothing.
-}
#endif
QT_END_NAMESPACE