summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/doc_src_objecttrees.cpp
blob: b7c71ccb6b01a31fceac959d80f1f8b142e49769 (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) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//![0]
int main()
{
    QWidget window;
    QPushButton quit("Quit", &window);
    ...
}
//![0]


//![1]
int main()
{
    QPushButton quit("Quit");
    QWidget window;

    quit.setParent(&window);
    ...
}
//![1]