Debian Codegraph @

examples/widgets/layouts/flowlayout/window.cpp

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4 #include <QPushButton>
5
6 #include "flowlayout.h"
7 #include "window.h"
8 //! [1]
9 Window::Window()
10 {
11 FlowLayout *flowLayout = new FlowLayout;
12
13 flowLayout->addWidget(new QPushButton(tr("Short")));
14 flowLayout->addWidget(new QPushButton(tr("Longer")));
15 flowLayout->addWidget(new QPushButton(tr("Different text")));
16 flowLayout->addWidget(new QPushButton(tr("More text")));
17 flowLayout->addWidget(new QPushButton(tr("Even longer button text")));
18 setLayout(flowLayout);
19
20 setWindowTitle(tr("Flow Layout"));
21 }
22 //! [1]