How to Add Holidays to QCalendarWidget

From Qt Wiki
Revision as of 19:28, 11 September 2017 by Simow (talk | contribs) (Cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The following source code marks the 3rd of March 2013 in a QCalendarWidget as a Holiday using the same style as weekends with QTextCharFormat.

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