comparison include/gui/widgets/optional_date.h @ 51:75c804f713b2

window: add about window, *: use tr() when applicable (useful for i18n)
author Paper <mrpapersonic@gmail.com>
date Mon, 25 Sep 2023 20:29:26 -0400
parents d8eb763e6661
children 3d2decf093bb
comparison
equal deleted inserted replaced
50:10868c3fb2be 51:75c804f713b2
1 #ifndef __gui__widgets__optional_date_h 1 #ifndef __gui__widgets__optional_date_h
2 #define __gui__widgets__optional_date_h 2 #define __gui__widgets__optional_date_h
3 #include <QWidget> 3 #include <QWidget>
4 #include "core/date.h"
4 5
5 class QCheckBox; 6 class QCheckBox;
6 class QDateEdit; 7 class QDateEdit;
7 class QDate; 8 class QDate;
8 9
9 class OptionalDate : public QWidget { 10 class OptionalDate : public QWidget {
11 Q_OBJECT
12
10 public: 13 public:
11 OptionalDate(QWidget* parent = nullptr); 14 OptionalDate(QWidget* parent = nullptr);
12 OptionalDate(bool enabled, QWidget* parent = nullptr); 15 OptionalDate(bool enabled, QWidget* parent = nullptr);
13 QDateEdit* GetDateEdit(); 16 QDateEdit* GetDateEdit();
14 QCheckBox* GetCheckBox(); 17 QCheckBox* GetCheckBox();
15 void SetDate(QDate date); 18 void SetDate(QDate date);
19 void SetDate(Date date);
20 Date GetDate();
16 void SetEnabled(bool enabled); 21 void SetEnabled(bool enabled);
17 bool IsEnabled(); 22 bool IsEnabled();
23
24 signals:
25 void DataChanged(bool checked, Date date);
18 26
19 private: 27 private:
20 QDateEdit* _dateedit; 28 QDateEdit* _dateedit;
21 QCheckBox* _checkbox; 29 QCheckBox* _checkbox;
22 }; 30 };