240 Q_PROPERTY(QDate selectedDate WRITE SetSelectedDate READ SelectedDate)
241 Q_PROPERTY(QString selectLunar READ SelectedLunar)
242 Q_PROPERTY(
int showYear READ GetShowYear)
243 Q_PROPERTY(
int showMonth READ GetShowMonth)
245 Q_PROPERTY(QDate minimumDate READ MinimumDate WRITE SetMinimumDate)
246 Q_PROPERTY(QDate maximumDate READ MaximumDate WRITE SetMaximumDate)
254 static const QString Version();
266 const QDate SelectedDate()
const;
279 void SetSelectedDate(
const QDate &date,
bool bForce =
false);
283 const QString SelectedLunar()
const;
288 const QString SelectedSolarTerm()
const;
295 int SelectedLunar(
int &year,
int &month,
int &day);
304 static int GetLunar(
const QDate date,
int &year,
int &month,
int &day);
317 bool EnableHolidays(
bool bEnable =
true);
323 bool EnableSolarTerm(
bool bEnable =
true);
368 QStringList& tasks) = 0;
389 int SetTaskHandle(QSharedPointer<CTaskHandler> handler);
418 std::function<uint(
const QDate& date,
419 QStringList& tasks)> cbHandler);
430 const QDate MinimumDate()
const;
434 void SetMinimumDate(
const QDate &date);
438 const QDate MaximumDate()
const;
442 void SetMaximumDate(
const QDate &date);
446 void SetDateRange(
const QDate &min,
const QDate &max);
452 const int GetShowYear()
const;
457 const int GetShowMonth()
const;
462 const Qt::DayOfWeek FirstDayOfWeek()
const;
482 int SetHeadposition(_HEAD_position pos = _HEAD_position::Top);
490 void ShowHead(
bool bShow);
495 void ShowTools(
bool bShow);
500 void ShowToday(
bool bShow);
505 void ShowDate(
bool bShow);
510 void ShowTime(
bool bShow);
516 void ShowWeekHead(
bool bShow);
521 void ShowWeeks(
bool bShow);
526 void ShowGrid(
bool show);
531 void EnableToolTip(
bool show);
536 void ShowBackgroupImage(
bool show);
542 CalendarTypeSolar = 0x01,
543 CalendarTypeLunar = 0x02
546 int SetCalendarType(_CalendarType type);
548 const _CalendarType GetCalendarType()
const;
556 int SetViewType(_VIEW_TYPE type);
558 const _VIEW_TYPE GetViewType()
const;
566 void setFont(
const QFont& font);
570 enum class _TOUCH_UP_DOWN_FUNCTION {
574 int SetTouchUpDownFunction(_TOUCH_UP_DOWN_FUNCTION f);
576 virtual QSize sizeHint()
const override;
577 virtual QSize minimumSizeHint()
const override;
590 int LoadCalendarTable(
const QString& szFile);
601 int GenerateCalendarTable(
const QString& szFile,
602 int nThreadNumber = 2,
603 bool bClearCache =
false,
604 bool bSaveAllDate =
true);
622 void soltShowToday();
625 void on_tbNextYear_clicked();
626 void on_tbPreviousYear_clicked();
627 void on_tbNextMonth_clicked();
628 void on_tbPreviousMonth_clicked();
629 void on_cbMonth_currentIndexChanged(
int index);
630 void on_cbYear_currentIndexChanged(
int index);
631 void on_tvMonth_pressed(
const QModelIndex &index);
636 bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
639 static void InitResource();
640 static void CLeanResource();
642 int ShowSelectTitle();
643 int UpdateViewModel(
bool bForce =
false);
644 int UpdateMonthMenu();
645 int EnableMonthMenu();
646 int SetBackgroup(
const QString& szFile);
647 int SetYearRange(
int min,
int max);
651 QToolButton m_tbPreYear, m_tbNextYear;
652 QComboBox m_cmbMonth;
653 QToolButton m_tbPreMonth, m_tbNextMonth;
654 QPushButton m_pbToday;
655 QLabel m_lbDate, m_lbTime;
658 QHBoxLayout* m_pToolLayout;
659 QVBoxLayout* m_pHeadLayout;
660 QGridLayout* m_pMainLayout;
663 int m_oldRow, m_oldCol;
666 bool m_bShowBackgroupImage;
668 _TOUCH_UP_DOWN_FUNCTION m_TouchFunction;