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
sharedcommentnode.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
5
6#include "aggregate.h"
7#include "functionnode.h"
8#include "qmltypenode.h"
9
11
12SharedCommentNode::SharedCommentNode(QmlTypeNode *parent, int count, QString &group)
13 : Node(Node::SharedComment, parent, group)
14{
15 m_collective.reserve(count);
16}
17
18/*!
19 Searches the shared comment node's member nodes for function
20 nodes. Each function node's overload flag is set.
21 */
23{
24 for (auto *node : m_collective) {
25 if (node->isFunction())
26 static_cast<FunctionNode *>(node)->setOverloadFlag();
27 }
28}
29
30/*!
31 Clone this node on the heap and make the clone a child of
32 \a parent.
33
34 Returns the pointer to the clone.
35 */
37{
38 auto *scn = new SharedCommentNode(*this); // shallow copy
39 scn->setParent(nullptr);
40 parent->addChild(scn);
41
42 return scn;
43}
44
45/*!
46 Sets the related nonmember flag in this node and in each
47 node in the shared comment's collective to \a value.
48 */
50{
52 for (auto *node : m_collective)
53 node->setRelatedNonmember(value);
54}
55
56QT_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.
virtual void setRelatedNonmember(bool b)
Sets a flag in the node indicating whether this node is a related nonmember of something.
Definition node.h:218
void setParent(Aggregate *n)
Sets the node's parent pointer to n.
Definition node.h:213
LinkType
An unsigned char value that probably should be moved out of the Node base class.
Definition node.h:112
void setOverloadFlags()
Searches the shared comment node's member nodes for function nodes.
Node * clone(Aggregate *parent) override
Clone this node on the heap and make the clone a child of parent.
void setRelatedNonmember(bool value) override
Sets the related nonmember flag in this node and in each node in the shared comment's collective to v...
Combined button and popup list for selecting options.