diff options
Diffstat (limited to 'tools/qdoc3/node.cpp')
-rw-r--r-- | tools/qdoc3/node.cpp | 85 |
1 files changed, 54 insertions, 31 deletions
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 56d76d3..709f03f 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -51,6 +51,8 @@ QT_BEGIN_NAMESPACE +ExampleNodeMap ExampleNode::exampleNodeMap; + /*! \class Node \brief The Node class is a node in the Tree. @@ -157,6 +159,16 @@ void Node::setLink(LinkType linkType, const QString &link, const QString &desc) } /*! + Sets the information about the project and version a node was introduced + in. The string is simplified, removing excess whitespace before being + stored. +*/ +void Node::setSince(const QString &since) +{ + sinc = since.simplified(); +} + +/*! Returns a string representing the access specifier. */ QString Node::accessString() const @@ -307,6 +319,38 @@ QString Node::ditaXmlHref() } /*! + If this node is a QML class node, return a pointer to it. + If it is a child of a QML class node, return a pointer to + the QML class node. Otherwise, return 0; + */ +const QmlClassNode* Node::qmlClassNode() const +{ + if (isQmlNode()) { + const Node* n = this; + while (n && n->subType() != Node::QmlClass) + n = n->parent(); + if (n && n->subType() == Node::QmlClass) + return static_cast<const QmlClassNode*>(n); + } + return 0; +} + +/*! + If this node is a QML node, find its QML class node, + and return a pointer to the C++ class node from the + QML class node. That pointer will be null if the QML + class node is a component. It will be non-null if + the QML class node is a QML element. + */ +const ClassNode* Node::declarativeCppNode() const +{ + const QmlClassNode* qcn = qmlClassNode(); + if (qcn) + return qcn->classNode(); + return 0; +} + +/*! \class InnerNode */ @@ -1063,6 +1107,16 @@ QString FakeNode::subTitle() const } /*! + The constructor calls the FakeNode constructor with + \a parent, \a name, and Node::Example. + */ +ExampleNode::ExampleNode(InnerNode* parent, const QString& name) + : FakeNode(parent, name, Node::Example) +{ + // nothing +} + +/*! \class EnumNode */ @@ -1684,37 +1738,6 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) } } -static QString valueType(const QString &n) -{ - if (n == "QPoint") - return "QDeclarativePointValueType"; - if (n == "QPointF") - return "QDeclarativePointFValueType"; - if (n == "QSize") - return "QDeclarativeSizeValueType"; - if (n == "QSizeF") - return "QDeclarativeSizeFValueType"; - if (n == "QRect") - return "QDeclarativeRectValueType"; - if (n == "QRectF") - return "QDeclarativeRectFValueType"; - if (n == "QVector2D") - return "QDeclarativeVector2DValueType"; - if (n == "QVector3D") - return "QDeclarativeVector3DValueType"; - if (n == "QVector4D") - return "QDeclarativeVector4DValueType"; - if (n == "QQuaternion") - return "QDeclarativeQuaternionValueType"; - if (n == "QMatrix4x4") - return "QDeclarativeMatrix4x4ValueType"; - if (n == "QEasingCurve") - return "QDeclarativeEasingValueType"; - if (n == "QFont") - return "QDeclarativeFontValueType"; - return QString(); -} - /*! Returns true if a QML property or attached property is read-only. The algorithm for figuring this out is long |