Debian Codegraph @

kysdk-qtwidgets/test/testloopplaypage/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
24 #include "kloopplaypage.h"
25 #include <QDebug>
26 #include <QLabel>
27 #include <QPushButton>
28 #include <QStackedWidget>
29 #include <QVBoxLayout>
30 #include <QWidget>
31
32 using namespace kdk;
33
34 Widget::Widget(QWidget *parent)
35 : QWidget(parent)
36 {
37 // QWidget*widget1 = new QWidget();
38
39 QLabel *label1 = new QLabel();
40 QPixmap pixmap1(":/1.jpeg");
41 label1->setFixedWidth(400);
42 label1->setPixmap(pixmap1.scaled(400, 200));
43 // QPushButton* btn1 = new QPushButton(widget1);
44 // btn1->move(100,50);
45 // btn1->setText("label1");
46
47 // QWidget*widget2 = new QWidget();
48 QLabel *label2 = new QLabel();
49 QPixmap pixmap2(":/2.jpeg");
50 label2->setPixmap(pixmap2.scaled(400, 200));
51 // QPushButton* btn2 = new QPushButton(widget2);
52 // btn2->move(100,50);
53 // btn2->setText("label2");
54
55 // QWidget*widget3 = new QWidget(this);
56 QLabel *label3 = new QLabel();
57 QPixmap pixmap3(":/3.jpg");
58 label3->setPixmap(pixmap3.scaled(400, 200));
59 // QPushButton* btn3 = new QPushButton(widget3);
60 // btn3->move(100,50);
61 // btn3->setText("label2");
62
63 // QWidget*widget4 = new QWidget();
64 QLabel *label4 = new QLabel();
65 QPixmap pixmap4(":/4.jpg");
66 label4->setPixmap(pixmap4.scaled(400, 200));
67 // QPushButton* btn4 = new QPushButton(widget4);
68 // btn4->move(100,50);
69 // btn4->setText("label2");
70
71 QHBoxLayout *layout = new QHBoxLayout(this);
72 KLoopPlayPage *page = new KLoopPlayPage();
73 page->addWidget(label1);
74 page->addWidget(label2);
75 page->addWidget(label3);
76 page->addWidget(label4);
77 page->setCurrentWidget(0);
78 layout->addWidget(page);
79
80 setFixedWidth(600);
81 }
82
83 Widget::~Widget()
84 {
85 }