English Български

How to Add Holidays to QCalendarWidget

The following source code marks 3 March 2013 at QCalendarWidget [qt-project.org] as a Holiday using the same weekends’ QTextCharFormat [qt-project.org].

  1. QDate date(2013,3,3);
  2. QTextCharFormat format = myCalendarWidget->weekdayTextFormat(Qt::Saturday);
  3.  
  4. myCalendarWidget->setDateTextFormat(date, format);

Categories: