def reformatCalendarPage(self):
if self.firstFridayCheckBox.isChecked():
firstFriday = QDate(self.calendar.yearShown(),
self.calendar.monthShown(), 1)
while firstFriday.dayOfWeek() != Qt.Friday:
firstFriday = firstFriday.addDays(1)
firstFridayFormat = QTextCharFormat()
firstFridayFormat.setForeground(Qt.blue)
self.calendar.setDateTextFormat(firstFriday, firstFridayFormat)
# May 1st in Red takes precedence.
if self.mayFirstCheckBox.isChecked():
mayFirst = QDate(self.calendar.yearShown(), 5, 1)
mayFirstFormat = QTextCharFormat()
mayFirstFormat.setForeground(Qt.red)
self.calendar.setDateTextFormat(mayFirst, mayFirstFormat)
评论列表
文章目录