Debian Codegraph @

kysdk-qtwidgets/test/testtitlewindow/widget.cpp

raw
1 /*
2 *
3 * Copyright (C) 2024, KylinSoft Co., Ltd.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 3 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this library. If not, see <https://www.gnu.org/licenses/>.
17 *
18 * Authors: Zhenyu Wang <[email protected]>
19 *
20 */
21
22 #include "widget.h"
23 #include "ktextedit.h"
24 #include "ktitlewindow.h"
25 #include <QBoxLayout>
26
27 using namespace kdk;
28 Widget::Widget(QWidget *parent)
29 : QWidget(parent)
30 {
31 KTitleWindow *window = new KTitleWindow();
32 QPushButton *btn1 = new QPushButton();
33 btn1->setText("测试button");
34 QHBoxLayout *layout = new QHBoxLayout();
35 layout->addWidget(btn1);
36 KTextEdit *edit = new KTextEdit();
37 edit->setLabelVisible(false);
38 QVBoxLayout *vlayout = new QVBoxLayout();
39 vlayout->addLayout(layout);
40 vlayout->addWidget(edit);
41 window->baseWidget()->setLayout(vlayout);
42 window->show();
43 }
44
45 Widget::~Widget()
46 {
47 }