Customised QCalendarWidget


class ourCalendarWidget : public QCalendarWidget
{
Q_OBJECT
public:
         ourCalendarWidget(QWidget *parent = 0) : QCalendarWidget(parent){}
        ~ourCalendarWidget() {}
void ourCall(QDate date)
{
    // here we set some conditions
    update();
}
protected:
void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
{
    if ( ) // our conditions
    {     // When the conditions are matched, passed QDate is drawn as we like.                              
         
        painter->save();
        painter->drawEllipse(rect);   // here we draw n ellipse and the day--
        painter->drawText(rec, Qt::TextSingleLine, Qt::AlignCenter,QString::number(date.day()));
        painter->restore();
    }
    else
    {   // if our conditions are not matching, show the default way.
        QCalendarWidget::paintCell(painter, rect, date);
    }
}