summaryrefslogtreecommitdiffstats
path: root/src/qdoc/qdoc/src/qdoc/variablenode.cpp
blob: 11c8363f3a7e32d5be1483c0d9d281251722541b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "variablenode.h"

QT_BEGIN_NAMESPACE

/*!
  Clone this node on the heap and make the clone a child of
  \a parent.

  Returns a pointer to the clone.
 */
Node *VariableNode::clone(Aggregate *parent)
{
    auto *vn = new VariableNode(*this); // shallow copy
    vn->setParent(nullptr);
    parent->addChild(vn);

    return vn;
}

QT_END_NAMESPACE