农历日历 v1.0.4
|
农历模型 更多...
#include <LunarCalendarModel.h>
Public 成员函数 | |
CLunarCalendarModel (QObject *parent=nullptr) | |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
bool | setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
得到数据 | |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
int | showMonth (int year, int month, bool bForce=false) |
int | showWeek (int year, int week, bool bForce=false) |
const int | GetShowWeek () const |
const int | GetShowMonth () const |
const int | GetShowYear () const |
const int | GetWeeksOfYear (int year=QDate::currentDate().day()) const |
int | setDate (const QDate &d) |
const QDate | GetDate () const |
int | SetMinimumDate (const QDate &date) |
const QDate | GetMinimumDate () const |
int | SetMaximumDate (const QDate &date) |
const QDate | GetMaximumDate () const |
int | setRange (const QDate &min, const QDate &max) |
const Qt::DayOfWeek | firstDayOfWeek () const |
const QDate | dateForCell (int row, int column) const |
void | cellForDate (const QDate &date, int *row, int *column) const |
void | EnableToolTip (bool enable) |
bool | EnableHolidays (bool bEnable=true) |
bool | EnableSolarTerm (bool bEnable=true) |
int | SetTaskHandle (QSharedPointer< CLunarCalendar::CTaskHandler > handler) |
virtual int | SetTaskHandle (std::function< uint(const QDate &, QStringList &)> cbHandler) |
int | SetCalendarType (CLunarCalendar::_CalendarType type) |
const CLunarCalendar::_CalendarType | GetCalendarType () const |
int | SetViewType (CLunarCalendar::_VIEW_TYPE type) |
const CLunarCalendar::_VIEW_TYPE | GetViewType () const |
农历模型
中国节假日表 SQL 文件: Src/Resource/database/chinese_holidays.sql
当有新的中国节假日时,修此表,加入新的即可。
在文件 LunarCalendarModel.h 第 48 行定义.
enum CLunarCalendarModel::_COLOR_ROLE |
在文件 LunarCalendarModel.h 第 64 行定义.
enum CLunarCalendarModel::_FONT_ROLE |
在文件 LunarCalendarModel.h 第 71 行定义.
enum CLunarCalendarModel::ROLE |
在文件 LunarCalendarModel.h 第 77 行定义.
|
explicit |
在文件 LunarCalendarModel.cpp 第 26 行定义.
|
virtual |
在文件 LunarCalendarModel.cpp 第 79 行定义.
void CLunarCalendarModel::cellForDate | ( | const QDate & | date, |
int * | row, | ||
int * | column | ||
) | const |
在文件 LunarCalendarModel.cpp 第 656 行定义.
|
override |
在文件 LunarCalendarModel.cpp 第 150 行定义.
|
override |
得到数据
数据初始化详见 slotUpdate . 得到数据:
在文件 LunarCalendarModel.cpp 第 163 行定义.
const QDate CLunarCalendarModel::dateForCell | ( | int | row, |
int | column | ||
) | const |
在文件 LunarCalendarModel.cpp 第 609 行定义.
bool CLunarCalendarModel::EnableHolidays | ( | bool | bEnable = true | ) |
在文件 LunarCalendarModel.cpp 第 871 行定义.
bool CLunarCalendarModel::EnableSolarTerm | ( | bool | bEnable = true | ) |
在文件 LunarCalendarModel.cpp 第 878 行定义.
void CLunarCalendarModel::EnableToolTip | ( | bool | enable | ) |
在文件 LunarCalendarModel.cpp 第 928 行定义.
const Qt::DayOfWeek CLunarCalendarModel::firstDayOfWeek | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 571 行定义.
|
override |
在文件 LunarCalendarModel.cpp 第 377 行定义.
const CLunarCalendar::_CalendarType CLunarCalendarModel::GetCalendarType | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 932 行定义.
const QDate CLunarCalendarModel::GetDate | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 595 行定义.
const QDate CLunarCalendarModel::GetMaximumDate | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 566 行定义.
const QDate CLunarCalendarModel::GetMinimumDate | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 547 行定义.
const int CLunarCalendarModel::GetShowMonth | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 504 行定义.
const int CLunarCalendarModel::GetShowWeek | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 509 行定义.
const int CLunarCalendarModel::GetShowYear | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 499 行定义.
const CLunarCalendar::_VIEW_TYPE CLunarCalendarModel::GetViewType | ( | ) | const |
在文件 LunarCalendarModel.cpp 第 916 行定义.
const int CLunarCalendarModel::GetWeeksOfYear | ( | int | year = QDate::currentDate().day() | ) | const |
在文件 LunarCalendarModel.cpp 第 806 行定义.
|
override |
在文件 LunarCalendarModel.cpp 第 85 行定义.
|
override |
在文件 LunarCalendarModel.cpp 第 143 行定义.
int CLunarCalendarModel::SetCalendarType | ( | CLunarCalendar::_CalendarType | type | ) |
在文件 LunarCalendarModel.cpp 第 921 行定义.
|
override |
在文件 LunarCalendarModel.cpp 第 358 行定义.
int CLunarCalendarModel::setDate | ( | const QDate & | d | ) |
在文件 LunarCalendarModel.cpp 第 514 行定义.
|
override |
在文件 LunarCalendarModel.cpp 第 133 行定义.
int CLunarCalendarModel::SetMaximumDate | ( | const QDate & | date | ) |
在文件 LunarCalendarModel.cpp 第 552 行定义.
int CLunarCalendarModel::SetMinimumDate | ( | const QDate & | date | ) |
在文件 LunarCalendarModel.cpp 第 532 行定义.
int CLunarCalendarModel::setRange | ( | const QDate & | min, |
const QDate & | max | ||
) |
在文件 LunarCalendarModel.cpp 第 581 行定义.
int CLunarCalendarModel::SetTaskHandle | ( | QSharedPointer< CLunarCalendar::CTaskHandler > | handler | ) |
在文件 LunarCalendarModel.cpp 第 885 行定义.
|
virtual |
在文件 LunarCalendarModel.cpp 第 895 行定义.
int CLunarCalendarModel::SetViewType | ( | CLunarCalendar::_VIEW_TYPE | type | ) |
在文件 LunarCalendarModel.cpp 第 909 行定义.
int CLunarCalendarModel::showMonth | ( | int | year, |
int | month, | ||
bool | bForce = false |
||
) |
在文件 LunarCalendarModel.cpp 第 400 行定义.
int CLunarCalendarModel::showWeek | ( | int | year, |
int | week, | ||
bool | bForce = false |
||
) |
在文件 LunarCalendarModel.cpp 第 391 行定义.