Debian Codegraph @

kysdk-qtwidgets/src/kprogresslabel.h

raw
1 /*
2 * libkysdk-qtwidgets's Library
3 *
4 * Copyright (C) 2023, KylinSoft Co., Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this library. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * Authors: Zhenyu Wang <[email protected]>
20 *
21 */
22
23 #ifndef MYWIDGET_H
24 #define MYWIDGET_H
25
26 #include <QColor>
27 #include <QHBoxLayout>
28 #include <QLabel>
29 #include <QPainter>
30 #include <QPalette>
31 #include <QSize>
32 #include <QWidget>
33
34 namespace kdk
35 {
36
37 /**
38 * @defgroup ProgressModule
39 * @since 2.5.2.0
40 * {
41 */
42
43 class KProgressLabelPrivate;
44
45 class KProgressLabel : public QWidget
46 {
47 Q_OBJECT
48 public:
49 KProgressLabel(QWidget *parent = nullptr);
50 ~KProgressLabel();
51
52 public:
53 /**
54 * @brief 设置第二行文本和第一行文本
55 * @param list1
56 * @param list2
57 */
58 void setStringList(QStringList list1, QStringList list2);
59
60 /**
61 * @brief setStringList
62 * @param list1
63 */
64 void setStringList(QStringList list1);
65
66 /**
67 * @brief 设置当前进度
68 * @param index
69 */
70 void setCurrentIndex(int index);
71
72 /**
73 * @brief 获取当前进度
74 * @return
75 */
76 int currentIndex();
77
78 /**
79 * @brief 设置圆形label的大小
80 * @param size
81 */
82 void setCircleSize(QSize size);
83
84 private:
85 Q_DECLARE_PRIVATE(KProgressLabel)
86 KProgressLabelPrivate *const d_ptr;
87 };
88
89 }
90 #endif // MYWIDGET_H