Debian Codegraph @

kysdk-qtwidgets/src/kpushbuttonframe.h

raw
1 /*
2 *
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: Sisheng He <[email protected]>
20 *
21 */
22 #ifndef PUSHBUTTONWIDGET_H
23 #define PUSHBUTTONWIDGET_H
24
25 #include "kbaseframe.h"
26 #include "klabel.h"
27 #include "kpushbutton.h"
28
29 /**
30 * @brief 创建一个带 QPushButton 的 Frame
31 *
32 */
33
34 namespace kdk
35 {
36
37 /**
38 * @defgroup ContainerModules
39 * @brief 带QpushButton的frame
40 * @since 3.0.1.0
41 * {
42 */
43
44 class KPushButtonFramePrivate;
45
46 class KPushButtonFrame : public KBaseFrame
47 {
48 Q_OBJECT
49 public:
50 /**
51 * @brief 创建一个带 QPushButton 的 Frame
52 *
53 * @param title: text of m_settingName
54 * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角)
55 * @param parent
56 */
57 explicit KPushButtonFrame(const QString title, QWidget *parent = nullptr, BorderRadiusStyle style = BorderRadiusStyle::None);
58 /**
59 * @brief
60 *
61 */
62 ~KPushButtonFrame();
63
64 /**
65 * @brief 获取 m_pushButton
66 *
67 * @return KPushButton: m_pushButton
68 */
69 KPushButton *pushButton();
70
71 /**
72 * @brief 获取label
73 *
74 * @return KLabel
75 */
76 KLabel *titleLabel();
77
78 /**
79 * @brief 获取layout
80 *
81 * @return QHBoxLayout
82 */
83 QHBoxLayout *mainHLayout();
84
85 private:
86 Q_DECLARE_PRIVATE(KPushButtonFrame)
87 KPushButtonFramePrivate *const d_ptr;
88 };
89
90 }
91
92 #endif // PUSHBUTTONWIDGET_H