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 Sets the enum associated with the typedef to the node specified by \a enume.
16 This is used to associate a flag type with the enum values that represent
17 individual flags.
18 */
19void TypedefNode::setAssociatedEnum(const EnumNode *enume)
20{
21 m_associatedEnum = enume;
22}
23
24/*!
25 Clone this node on the heap and make the clone a child of
26 \a parent.
27
28 Returns the pointer to the clone.
29 */
31{
32 auto *tn = new TypedefNode(*this); // shallow copy
33 tn->setParent(nullptr);
34 parent->addChild(tn);
35
36 return tn;
37}
38
39/*!
40 Extends the base implementation to test whether an associated enum
41 is in the API.
42*/
43bool TypedefNode::isInAPI() const
44{
45 return Node::isInAPI() || (m_associatedEnum && m_associatedEnum->isInAPI());
46}
47
48/*!
49 \class TypeAliasNode
50 */
51
52/*!
53 Clone this node on the heap and make the clone a child of
54 \a parent.
55
56 Returns the pointer to the clone.
57 */
59{
60 auto *tan = new TypeAliasNode(*this); // shallow copy
61 tan->setParent(nullptr);
62 parent->addChild(tan);
63
64 return tan;
65}
66
67QT_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
Returns true if this node is considered to be part of the API as per the InclusionPolicy retrieved fr...
Definition node.cpp:927
void setParent(Aggregate *n)
Sets the node's parent pointer to n.
Definition node.h:182