Debian Codegraph @

kysdk-qtwidgets/src/ktranslucentfloor.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 KTRANSLUCENTFLOOR_H
24 #define KTRANSLUCENTFLOOR_H
25
26 #include "gui_g.h"
27 #include <QFrame>
28
29 namespace kdk
30 {
31
32 /**
33 * @defgroup FrameModule
34 * {
35 */
36 class KTranslucentFloorPrivate;
37
38 /**
39 * @brief 提供一个半透明底板,可作为基础窗体进行布局
40 * @since 1.2.0
41 */
42 class GUI_EXPORT KTranslucentFloor : public QFrame
43 {
44 Q_OBJECT
45 public:
46 KTranslucentFloor(QWidget *parent = nullptr);
47
48 /**
49 * @brief 设置圆角半径
50 * @param radius
51 */
52 void setBorderRadius(int radius);
53
54 /**
55 * @brief 返回圆角半径
56 * @return
57 */
58 int borderRadius();
59
60 /**
61 * @brief 设置是否显示阴影
62 * @param flag
63 */
64 void setShadow(bool flag);
65
66 /**
67 * @brief 返回是否显示阴影
68 * @return
69 */
70 bool shadow();
71
72 /**
73 * @brief 设置是否启用毛玻璃效果
74 * @param flag
75 */
76 void setEnableBlur(bool flag);
77
78 /**
79 * @brief 获取是否已启用毛玻璃效果
80 * @return
81 */
82 bool enableBlur();
83
84 /**
85 * @brief 设置透明度
86 * @param opacity
87 */
88 void setOpacity(qreal opacity);
89
90 /**
91 * @brief 获取透明度
92 * @return
93 */
94 qreal opacity();
95
96 protected:
97 void paintEvent(QPaintEvent *);
98
99 private:
100 KTranslucentFloorPrivate *const d_ptr;
101 Q_DECLARE_PRIVATE(KTranslucentFloor)
102 };
103 }
104
105 #endif // KTRANSLUCENTFLOOR_H