How to specify Holidays and Weekends in QCalendarWidget and change the Color.
-
Hii...
I am trying to create a calendar widget, in that the weekends are already shown in red color. Now i just want to specify some dates as Holidays and also i want to change the color of that specified dates (holidays) in Red color. How can i specify that these are the public holidays in a QCalendarWidget and to change its color.
Thanks & Regards…
-
Use "QCalendarWidget::setDateTextFormat":http://qt-project.org/doc/qt-5.0/qtwidgets/qcalendarwidget.html#setDateTextFormat to set the format of the specified date. Here is an example that applied the weekend format over a specified date:
@
QDate date(2013,2,28);
QTextCharFormat format = myCalendarWidget->weekdayTextFormat(Qt::Saturday);myCalendarWidget->setDateTextFormat(date, format);
@ -
Thanks leon.anavi for your suggestion... :) It Works... :)
-
[quote author="Rochi" date="1362061920"]Thanks leon.anavi for your suggestion... :) It Works... :)[/quote]
Cool, you are welcome :)