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 Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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);