Debian Codegraph @

kysdk-qtwidgets/src/klunardateedit.h

raw
1 /*
2 * libkysdk-qtwidgets's Library
3 *
4 * Copyright (C) 2024, 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 KLUNARDATEEDIT_H
24 #define KLUNARDATEEDIT_H
25
26 #include "gui_g.h"
27 #include <QDateEdit>
28 #include <QObject>
29 #include <QWidget>
30
31 namespace kdk
32 {
33 class KLunarDateEditPrivate;
34
35 /**
36 * @defgroup KLunarDateEdit
37 * @since 2.5.2.0
38 */
39
40 class GUI_EXPORT KLunarDateEdit : public QWidget
41 {
42 Q_OBJECT
43 public:
44 explicit KLunarDateEdit(QWidget *parent = nullptr);
45
46 /**
47 * @brief 是否显示农历
48 * @param showLunar:true显示,false不显示
49 */
50 void setShowLunar(bool showLunar);
51
52 /**
53 * @brief 获取控件中的DateEdit控件
54 * @return
55 */
56 QDateTimeEdit *getDateEdit();
57
58 protected:
59 void resizeEvent(QResizeEvent *event);
60
61 signals:
62 void dateChanged(QDate);
63
64 private slots:
65 void slotPaletteChanged();
66 void slotDateChanged(QDate date);
67 void slotClicked();
68
69 private:
70 Q_DECLARE_PRIVATE(KLunarDateEdit)
71 KLunarDateEditPrivate *const d_ptr;
72 };
73 }
74
75 #endif // KLUNARDATEEDIT_H