农历日历 v1.0.4
|
农历日历类 更多...
#include <LunarCalendar.h>
类 | |
class | CTaskHandler |
使用者自定义任务接口 类 更多... | |
Public 类型 | |
enum class | _TOUCH_UP_DOWN_FUNCTION { TouchChangeView , TouchChangeMounth } |
信号 | |
void | sigSelectionChanged () |
当前选择日期改变时触发 可以在相应的槽函数中调用下列函数 | |
Public 成员函数 | |
CLunarCalendar (QWidget *parent=nullptr) | |
int | SetTouchUpDownFunction (_TOUCH_UP_DOWN_FUNCTION f) |
virtual QSize | sizeHint () const override |
virtual QSize | minimumSizeHint () const override |
下列功能仅由开发者使用。客户和使用者禁止使用。 | |
int | LoadCalendarTable (const QString &szFile) |
从缓存文件中得到农历 | |
int | GenerateCalendarTable (const QString &szFile, int nThreadNumber=2, bool bClearCache=false, bool bSaveAllDate=true) |
产生日历缓存表 | |
静态 Public 成员函数 | |
static const QString | Version () |
Protected 成员函数 | |
bool | eventFilter (QObject *watched, QEvent *event) Q_DECL_OVERRIDE |
属性 | |
QDate | selectedDate |
QString | selectLunar |
int | showYear |
int | showMonth |
QDate | minimumDate |
QDate | maximumDate |
设置界面 | |
enum class | _HEAD_position { Not = 0 , Top , Down , Left , Right } |
enum class | _CalendarType { CalendarTypeSolar = 0x01 , CalendarTypeLunar = 0x02 } |
日历类型 更多... | |
enum class | _VIEW_TYPE { ViewTypeMonth , ViewTypeWeek } |
视图类型 更多... | |
int | SetHeadposition (_HEAD_position pos=_HEAD_position::Top) |
设置日历头的位置 | |
int | SetCalendarType (_CalendarType type) |
设置日历类型(组合) | |
const _CalendarType | GetCalendarType () const |
得到日历类型 | |
int | SetViewType (_VIEW_TYPE type) |
设置视图类型 | |
const _VIEW_TYPE | GetViewType () const |
得到视图类型 | |
int | Update () |
更新数据和视图 | |
void | setFont (const QFont &font) |
void | ShowHead (bool bShow) |
显示或隐藏日历头 | |
void | ShowTools (bool bShow) |
显示或隐藏日期工具按钮 | |
void | ShowToday (bool bShow) |
显示或隐藏今日工具按钮 | |
void | ShowDate (bool bShow) |
显示或隐藏选择日期 | |
void | ShowTime (bool bShow) |
显示或隐藏当前时间 | |
void | ShowWeekHead (bool bShow) |
显示或隐藏周 | |
void | ShowWeeks (bool bShow) |
显示或隐藏第几周 | |
void | ShowGrid (bool show) |
显示或隐藏网格 | |
void | EnableToolTip (bool show) |
显示或隐藏工具提示 | |
void | ShowBackgroupImage (bool show) |
显示或隐藏背景图片 | |
日期操作 | |
const QDate | SelectedDate () const |
得到当前选择的日期。 当前选择的日期在指定的最小日期 MinimumDate() 与最大日期 MaximumDate() 的范围内。 默认为系统当前日期。 | |
void | SetSelectedDate (const QDate &date, bool bForce=false) |
设置当前选择的日期 | |
const QString | SelectedLunar () const |
得到当前选择的日期的农历的字符串 | |
const QString | SelectedSolarTerm () const |
得到当前选的节气 | |
int | SelectedLunar (int &year, int &month, int &day) |
得到当前选择的日期的农历 | |
const QDate | MinimumDate () const |
得到日历的支持最小日期 | |
void | SetMinimumDate (const QDate &date) |
设置日历的支持最小日期 | |
const QDate | MaximumDate () const |
得到日历的支持最大日期 | |
void | SetMaximumDate (const QDate &date) |
设置日历的支持最大日期 | |
void | SetDateRange (const QDate &min, const QDate &max) |
设置日历的支持日期的范围 | |
const int | GetShowYear () const |
得到当前界面显示的年份 | |
const int | GetShowMonth () const |
得到当前界面显示的月份 | |
const Qt::DayOfWeek | FirstDayOfWeek () const |
得到年周从哪天开始 | |
static int | GetLunar (const QDate date, int &year, int &month, int &day) |
得到给定日期的农历(公历转农历) | |
节日、周年纪念日、任务操作 | |
int | SetTaskHandle (QSharedPointer< CTaskHandler > handler) |
设置 使用者自定义任务接口 | |
virtual int | SetTaskHandle (std::function< uint(const QDate &date, QStringList &tasks)> cbHandler) |
设置 使用者自定义任务接口 | |
bool | EnableHolidays (bool bEnable=true) |
允许或禁用节日 | |
bool | EnableSolarTerm (bool bEnable=true) |
允许或禁用节气 | |
农历日历类
显示阳历、农历、节日、任务
在文件 LunarCalendar.h 第 237 行定义.
|
strong |
|
strong |
枚举值 | |
---|---|
Not | 无 |
Top | 上 |
Down | 下 |
Left | 左 |
Right | 右 |
在文件 LunarCalendar.h 第 470 行定义.
|
strong |
在文件 LunarCalendar.h 第 570 行定义.
|
strong |
|
explicit |
在文件 LunarCalendar.cpp 第 40 行定义.
|
overridevirtual |
在文件 LunarCalendar.cpp 第 245 行定义.
|
slot |
|
slot |
|
slot |
显示或隐藏工具提示
在文件 LunarCalendar.cpp 第 542 行定义.
|
protected |
在文件 LunarCalendar.cpp 第 994 行定义.
const Qt::DayOfWeek CLunarCalendar::FirstDayOfWeek | ( | ) | const |
int CLunarCalendar::GenerateCalendarTable | ( | const QString & | szFile, |
int | nThreadNumber = 2 , |
||
bool | bClearCache = false , |
||
bool | bSaveAllDate = true |
||
) |
产生日历缓存表
szFile | 缓存文件 |
nThreadNumber | 产生的线程数 |
bClearCache | 是否清除以前的缓存 |
bSaveAllDate | 是否保存所有日期 |
在文件 LunarCalendar.cpp 第 1305 行定义.
const CLunarCalendar::_CalendarType CLunarCalendar::GetCalendarType | ( | ) | const |
得到日历类型
在文件 LunarCalendar.cpp 第 1279 行定义.
|
static |
const int CLunarCalendar::GetShowMonth | ( | ) | const |
const int CLunarCalendar::GetShowYear | ( | ) | const |
const CLunarCalendar::_VIEW_TYPE CLunarCalendar::GetViewType | ( | ) | const |
得到视图类型
在文件 LunarCalendar.cpp 第 1265 行定义.
int CLunarCalendar::LoadCalendarTable | ( | const QString & | szFile | ) |
const QDate CLunarCalendar::MaximumDate | ( | ) | const |
得到日历的支持最大日期
在文件 LunarCalendar.cpp 第 714 行定义.
const QDate CLunarCalendar::MinimumDate | ( | ) | const |
得到日历的支持最小日期
在文件 LunarCalendar.cpp 第 751 行定义.
|
overridevirtual |
在文件 LunarCalendar.cpp 第 1366 行定义.
const QDate CLunarCalendar::SelectedDate | ( | ) | const |
得到当前选择的日期。 当前选择的日期在指定的最小日期 MinimumDate() 与最大日期 MaximumDate() 的范围内。 默认为系统当前日期。
在文件 LunarCalendar.cpp 第 594 行定义.
const QString CLunarCalendar::SelectedLunar | ( | ) | const |
得到当前选择的日期的农历的字符串
在文件 LunarCalendar.cpp 第 661 行定义.
int CLunarCalendar::SelectedLunar | ( | int & | year, |
int & | month, | ||
int & | day | ||
) |
const QString CLunarCalendar::SelectedSolarTerm | ( | ) | const |
int CLunarCalendar::SetCalendarType | ( | _CalendarType | type | ) |
设置日历类型(组合)
在文件 LunarCalendar.cpp 第 1289 行定义.
void CLunarCalendar::SetDateRange | ( | const QDate & | min, |
const QDate & | max | ||
) |
设置日历的支持日期的范围
在文件 LunarCalendar.cpp 第 787 行定义.
void CLunarCalendar::setFont | ( | const QFont & | font | ) |
在文件 LunarCalendar.cpp 第 1353 行定义.
int CLunarCalendar::SetHeadposition | ( | _HEAD_position | pos = _HEAD_position::Top | ) |
void CLunarCalendar::SetMaximumDate | ( | const QDate & | date | ) |
设置日历的支持最大日期
在文件 LunarCalendar.cpp 第 721 行定义.
void CLunarCalendar::SetMinimumDate | ( | const QDate & | date | ) |
设置日历的支持最小日期
在文件 LunarCalendar.cpp 第 758 行定义.
void CLunarCalendar::SetSelectedDate | ( | const QDate & | date, |
bool | bForce = false |
||
) |
设置当前选择的日期
date | 将选择的日期。 |
bForce |
|
在文件 LunarCalendar.cpp 第 601 行定义.
int CLunarCalendar::SetTaskHandle | ( | QSharedPointer< CTaskHandler > | handler | ) |
设置 使用者自定义任务接口
handler | 任务处理类(CTaskHandler) |
使用方法:
在文件 LunarCalendar.cpp 第 1209 行定义.
|
virtual |
设置 使用者自定义任务接口
date | 要处理的日期 |
tasks | 任务列表。如果使用者有新任务,并需要在农历位置处显示内容,则加入到此列表中。 |
例子:
int CLunarCalendar::SetTouchUpDownFunction | ( | _TOUCH_UP_DOWN_FUNCTION | f | ) |
在文件 LunarCalendar.cpp 第 1273 行定义.
int CLunarCalendar::SetViewType | ( | _VIEW_TYPE | type | ) |
设置视图类型
在文件 LunarCalendar.cpp 第 1227 行定义.
|
slot |
显示或隐藏背景图片
在文件 LunarCalendar.cpp 第 526 行定义.
|
slot |
|
slot |
显示或隐藏网格
在文件 LunarCalendar.cpp 第 516 行定义.
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
signal |
当前选择日期改变时触发 可以在相应的槽函数中调用下列函数
|
overridevirtual |
在文件 LunarCalendar.cpp 第 1361 行定义.
int CLunarCalendar::Update | ( | ) |
|
static |
在文件 LunarCalendar.cpp 第 1494 行定义.
|
readwrite |
在文件 LunarCalendar.h 第 246 行定义.
|
readwrite |
在文件 LunarCalendar.h 第 245 行定义.
|
readwrite |
在文件 LunarCalendar.h 第 240 行定义.
|
read |
在文件 LunarCalendar.h 第 241 行定义.
|
read |
在文件 LunarCalendar.h 第 243 行定义.
|
read |
在文件 LunarCalendar.h 第 242 行定义.