Debian Codegraph @

kysdk-qtwidgets/src/kcomboboxframe.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 KCOMBOBOXFRAME_H
23 #define KCOMBOBOXFRAME_H
24
25 #include "klabel.h"
26 #include <QComboBox>
27 #include <QObject>
28
29 #include "kbaseframe.h"
30
31 namespace kdk
32 {
33
34 /**
35 * @defgroup ContainerModules
36 * @brief 存在combox的frame
37 * @since 3.0.1.0
38 * {
39 */
40 class KComboBoxFramePrivate;
41
42 class KComboBoxFrame : public KBaseFrame
43 {
44 Q_OBJECT
45 public:
46 /**
47 * @brief 创建一个带 QComboBox 的 Frame
48 *
49 * @param title: text of m_settingName
50 * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角)
51 * @param parent
52 */
53 explicit KComboBoxFrame(const QString title, QWidget *parent = nullptr, BorderRadiusStyle style = BorderRadiusStyle::None);
54 ~KComboBoxFrame();
55
56 /**
57 * @brief 获取label
58 *
59 * @return QLabel
60 */
61 KLabel *titleLabel();
62
63 /**
64 * @brief 获取layout
65 *
66 * @return QHBoxLayout
67 */
68 QHBoxLayout *mainHLayout();
69
70 /**
71 * @brief 获取下拉框控件
72 *
73 * @return QComboBox
74 */
75 QComboBox *comboBox();
76
77 private:
78 Q_DECLARE_PRIVATE(KComboBoxFrame)
79 KComboBoxFramePrivate *const d_ptr;
80 };
81
82 }
83
84 #endif // KCOMBOBOXFRAME_H