Debian Codegraph @

kysdk-qtwidgets/src/kitemwidget.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 KITEMWIDGET_H
24 #define KITEMWIDGET_H
25
26 #include "gui_g.h"
27 #include "themeController.h"
28 #include <QFont>
29 #include <QHBoxLayout>
30 #include <QIcon>
31 #include <QListWidget>
32 #include <QListWidgetItem>
33 #include <QPainter>
34 #include <QPixmap>
35 #include <QSize>
36 #include <QString>
37 #include <QVBoxLayout>
38 #include <QWidget>
39
40 namespace kdk
41 {
42 /**
43 * @since 1.2.0
44 */
45
46 class KItemWidgetPrivate;
47
48 class GUI_EXPORT KItemWidget : public QWidget
49 {
50 Q_OBJECT
51 public:
52 /*
53 * Myicon 需要显示的图片
54 * MmainText 需要写入的miantext
55 * MsecText 需要写入的sectext
56 */
57 KItemWidget(const QIcon &Myicon, QString MmainText, QString MsecText, QWidget *parent);
58 /*
59 * 设置反白效果
60 */
61 void SetInverse();
62
63 /*
64 * 取消反白效果
65 */
66 void CancelInverse();
67 /*
68 * 设置图片大小
69 */
70 void SetIconSize(QSize size);
71
72 protected:
73 void paintEvent(QPaintEvent *event);
74 /*void mousePressEvent(QMouseEvent *event);*/
75
76 private:
77 Q_DECLARE_PRIVATE(KItemWidget);
78 KItemWidgetPrivate *const d_ptr;
79 };
80
81 }
82 #endif // KITEMWIDGET_H