Debian Codegraph @

tests/dde-calendar-client-test/src/test_widget/test_monthWidget/test_monthview.cpp

raw
1 // SPDX-FileCopyrightText: 2019 - 2026 UnionTech Software Technology Co., Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-or-later
4
5 #include "test_monthview.h"
6
7 //test_monthview::test_monthview()
8 //{
9 // mMonthView = new CMonthView();
10 //}
11
12 //test_monthview::~test_monthview()
13 //{
14 // delete mMonthView;
15 // mMonthView = nullptr;
16 //}
17
18 //QVector<ScheduleDataInfo> getMonthViewScheduleDInfo()
19 //{
20 // QVector<ScheduleDataInfo> scheduleDate {};
21 // ScheduleDataInfo schedule1, schedule2, schedule3, schedule4, schedule5, scheduleFes;
22 // QDateTime currentDateTime = QDateTime::currentDateTime();
23
24 // schedule1.setID(1);
25 // schedule1.setBeginDateTime(currentDateTime);
26 // schedule1.setEndDateTime(currentDateTime.addDays(1));
27 // schedule1.setTitleName("scheduleOne");
28 // schedule1.setAllDay(true);
29 // schedule1.setType(1);
30 // schedule1.setRecurID(0);
31
32 // schedule2.setID(2);
33 // schedule2.setBeginDateTime(currentDateTime.addDays(1));
34 // schedule2.setEndDateTime(currentDateTime.addDays(1).addSecs(60 * 60));
35 // schedule2.setTitleName("scheduleTwo");
36 // schedule2.setAllDay(true);
37 // schedule2.setType(2);
38 // schedule2.setRecurID(0);
39
40 // schedule3.setID(3);
41 // schedule3.setBeginDateTime(currentDateTime.addDays(2));
42 // schedule3.setEndDateTime(currentDateTime.addDays(2).addSecs(60 * 60));
43 // schedule3.setTitleName("scheduleThree");
44 // schedule3.setAllDay(false);
45 // schedule3.setType(3);
46 // schedule3.setRecurID(0);
47
48 // schedule4.setID(4);
49 // schedule4.setBeginDateTime(currentDateTime.addDays(3));
50 // schedule4.setEndDateTime(currentDateTime.addDays(3).addSecs(60 * 60));
51 // schedule4.setTitleName("scheduleFour");
52 // schedule4.setAllDay(false);
53 // schedule4.setType(1);
54 // schedule4.setRecurID(0);
55
56 // schedule5.setID(5);
57 // schedule5.setBeginDateTime(currentDateTime.addDays(4));
58 // schedule5.setEndDateTime(currentDateTime.addDays(4).addSecs(60 * 60));
59 // schedule5.setTitleName("scheduleFive");
60 // schedule5.setAllDay(false);
61 // schedule5.setType(2);
62 // schedule5.setRecurID(0);
63
64 // scheduleFes.setID(6);
65 // scheduleFes.setBeginDateTime(currentDateTime.addDays(5));
66 // scheduleFes.setEndDateTime(currentDateTime.addDays(5).addSecs(60 * 60));
67 // scheduleFes.setTitleName("scheduleFestival");
68 // scheduleFes.setAllDay(true);
69 // scheduleFes.setType(4);
70 // scheduleFes.setRecurID(0);
71
72 // scheduleDate.append(schedule1);
73 // scheduleDate.append(schedule2);
74 // scheduleDate.append(schedule3);
75 // scheduleDate.append(schedule4);
76 // scheduleDate.append(schedule5);
77 // scheduleDate.append(scheduleFes);
78 // return scheduleDate;
79 //}
80
81 //QVector<QDate> MonthviewGetDayList()
82 //{
83 // QVector<QDate> dateList {};
84 // QDate currentDate = QDate::currentDate();
85 // for (int i = 0; i < 42; i++) {
86 // dateList.append(currentDate.addDays(i));
87 // }
88
89 // return dateList;
90 //}
91
92 //QMap<QDate, CaHuangLiDayInfo> MonthViewGetHuangLiDayInfo()
93 //{
94 // QMap<QDate, CaHuangLiDayInfo> huangLiDayinfo {};
95 // CaHuangLiDayInfo huangLiInfo1 {};
96 // huangLiInfo1.mGanZhiYear = "辛丑牛年"; //年干支
97 // huangLiInfo1.mGanZhiMonth = "庚寅月"; //月干支
98 // huangLiInfo1.mGanZhiDay = "辛卯日"; //日干支
99 // huangLiInfo1.mLunarMonthName = "正月"; //农历月名称
100 // huangLiInfo1.mLunarDayName = "初一"; //农历日名称
101 // huangLiInfo1.mLunarLeapMonth = 4; //闰月
102 // huangLiInfo1.mZodiac = "牛"; //生肖
103 // huangLiInfo1.mTerm = ""; //农历节气
104 // huangLiInfo1.mSolarFestival = "国庆节"; //阳历节日
105 // huangLiInfo1.mLunarFestival = "除夕"; //农历节日
106 // huangLiInfo1.mSuit = "嫁娶"; //黄历宜
107 // huangLiInfo1.mAvoid = "入土"; //黄历忌
108
109 // huangLiDayinfo.insert(QDate::currentDate(), huangLiInfo1);
110 // return huangLiDayinfo;
111 //}
112
113 ////void CMonthView::setTheMe(int type)
114 //TEST_F(test_monthview, setTheMe)
115 //{
116 // mMonthView->setTheMe(1);
117 // mMonthView->setTheMe(2);
118 //}
119
120 ////void CMonthView::setSelectSchedule(const ScheduleDataInfo &scheduleInfo)
121 //TEST_F(test_monthview, setSelectSchedule)
122 //{
123 // ScheduleDataInfo scheduleinfo = getMonthViewScheduleDInfo().first();
124 // mMonthView->setSelectSchedule(scheduleinfo);
125 //}
126
127 ////void CMonthView::slotScheduleRemindWidget(const bool isShow, const ScheduleDataInfo &out)
128 //TEST_F(test_monthview, slotScheduleRemindWidget)
129 //{
130 // ScheduleDataInfo scheduleinfo = getMonthViewScheduleDInfo().first();
131 // mMonthView->slotScheduleRemindWidget(false, scheduleinfo);
132 // mMonthView->slotScheduleRemindWidget(true, scheduleinfo);
133 //}
134
135 ////void CMonthView::setFirstWeekday(Qt::DayOfWeek weekday)
136 //TEST_F(test_monthview, setFirstWeekday)
137 //{
138 // mMonthView->setFirstWeekday(Qt::Sunday);
139 //}
140
141 ////void CMonthView::setShowDate(const QVector<QDate> &showDate)
142 //TEST_F(test_monthview, setShowDate)
143 //{
144 // mMonthView->setShowDate(MonthviewGetDayList());
145 //}
146
147 ////void CMonthView::setHuangLiInfo(const QMap<QDate, CaHuangLiDayInfo> &huangLiInfo)
148 //TEST_F(test_monthview, setHuangLiInfo)
149 //{
150 // mMonthView->setHuangLiInfo(MonthViewGetHuangLiDayInfo());
151 //}
152
153 ////void CMonthView::setFestival(const QMap<QDate, int> &festivalInfo)
154 //TEST_F(test_monthview, setFestival)
155 //{
156 // QMap<QDate, int> festivalInfo {};
157 // festivalInfo.insert(QDate::currentDate(), 1);
158 // festivalInfo.insert(QDate::currentDate().addDays(1), 2);
159 // mMonthView->setFestival(festivalInfo);
160 //}
161
162 ////void CMonthView::setScheduleInfo(const QMap<QDate, QVector<ScheduleDataInfo> > &scheduleInfo)
163 //TEST_F(test_monthview, setScheduleInfo)
164 //{
165 // QMap<QDate, QVector<ScheduleDataInfo>> scheduleinfo {};
166 // scheduleinfo.insert(QDate::currentDate(), getMonthViewScheduleDInfo());
167 // mMonthView->setScheduleInfo(scheduleinfo);
168 //}
169
170 ////void CMonthView::setSearchScheduleInfo(const QVector<ScheduleDataInfo> &searchScheduleInfo)
171 //TEST_F(test_monthview, setSearchScheduleInfo)
172 //{
173 // mMonthView->setSearchScheduleInfo(getMonthViewScheduleDInfo());
174 //}
175
176 ////void CMonthView::setCurrentDate(const QDate &currentDate)
177 //TEST_F(test_monthview, setCurrentDate)
178 //{
179 // mMonthView->setCurrentDate(QDate::currentDate());
180 //}
181
182 ////ScheduleDataInfo CMonthView::getScheduleInfo(const QDate &beginDate, const QDate &endDate)
183 //TEST_F(test_monthview, getScheduleInfo)
184 //{
185 // QDate currentDate = QDate::currentDate();
186 // QDate currentDate1 = QDate::currentDate().addDays(1);
187 // mMonthView->getScheduleInfo(currentDate, currentDate1);
188 // mMonthView->getScheduleInfo(currentDate1, currentDate);
189 //}
190
191 //TEST_F(test_monthview, isDragging)
192 //{
193 // mMonthView->isDragging();
194 //}