1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #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);
-
- QDate execShow();
-
- void setDate(const QDate& date);
-
- QDate getDate() const { return m_date; }
- 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
|