Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
typedefnode.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "typedefnode.h"
5
6#include "aggregate.h"
7
9
10/*!
11 \class TypedefNode
12 */
13
14/*!
15 */
16void TypedefNode::setAssociatedEnum(const EnumNode *enume)
17{
18 m_associatedEnum = enume;
19}
20
21/*!
22 Clone this node on the heap and make the clone a child of
23 \a parent.
24
25 Returns the pointer to the clone.
26 */
28{
29 auto *tn = new TypedefNode(*this); // shallow copy
30 tn->setParent(nullptr);
31 parent->addChild(tn);
32
33 return tn;
34}
35
36/*!
37 Extends the base implementation to test whether an associated enum
38 is in the API.
39*/
40bool TypedefNode::isInAPI() const
41{
42 return Node::isInAPI() || (m_associatedEnum && m_associatedEnum->isInAPI());
43}
44
45/*!
46 \class TypeAliasNode
47 */
48
49/*!
50 Clone this node on the heap and make the clone a child of
51 \a parent.
52
53 Returns the pointer to the clone.
54 */
56{
57 auto *tan = new TypeAliasNode(*this); // shallow copy
58 tan->setParent(nullptr);
59 parent->addChild(tan);
60
61 return tan;
62}
63
64QT_END_NAMESPACE
void addChild(Node *child)
Adds the child to this node's child list and sets the child's parent pointer to this Aggregate.
Node * clone(Aggregate *parent) override
Clone this node on the heap and make the clone a child of parent.
bool isInAPI() const override
Extends the base implementation to test whether an associated enum is in the API.
Node * clone(Aggregate *parent) override
Clone this node on the heap and make the clone a child of parent.
Combined button and popup list for selecting options.
The Node class is the base class for all the nodes in QDoc's parse tree.
virtual bool isInAPI() const
Definition node.h:243
void setParent(Aggregate *n)
Sets the node's parent pointer to n.
Definition node.h:187