123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef CDATE_H
- #define CDATE_H
- #include <QDialog>
- #include <QWidget>
- #include <QDate>
- class CalendarWidgetEx;
- class OneShadow;
- class CDate : public QWidget
- {
- Q_OBJECT
- const int RADIUS = 16;
- const int CALENDAR_WIDTH = 325;
- const int CALENDAR_HEIGHT = 350;
- public:
- enum PopupType{
- Popup = 0,
- NoPopup = 1
- };
- CDate(const QDate& defaultDate,QWidget *parent = nullptr,PopupType type = Popup);
- CDate(QWidget *parent = nullptr,PopupType type = Popup);
- signals:
- void signal_DateChanged(const QDate& date);
- void signal_close();
- protected:
- void paintEvent(QPaintEvent *event);
- bool eventFilter(QObject *watched, QEvent *event);
- private:
- void init(const QDate& defaultDate);
- private:
- QDate m_date;
- CalendarWidgetEx* m_calendarEx = nullptr;
- OneShadow* m_shadow = nullptr;
- QWidget* m_parent = nullptr;
- PopupType m_type;
- };
- #endif
|