I am facing a problem regarding the coloration of a specific date on my QWidgetCalender. I
have to subclass QCalenderWidget and to reimplement de function painCell. What I did. And I have called
the function paintCell in my appropriate window, but I have this error message:

Error : no matching function for call to 'MyCalender:aintCell(QPainter*&, <unresolved overloaded function type>, const QDate&)'
Candidates are: virtual void MyCalender:aintCell(QPainter*, const QRect&, const QDate&)

What am I doing wrong?

Many thanks in advance.

Here is my code:

I subclass here QCalenderWidget and I reimplement paintCell:

Qt Code:
  1. class MyCalender: public QCalendarWidget
  2. {
  3. public:
  4. MyCalender(QWidget *parent);
  5. ~MyCalender();
  6.  
  7.  
  8. protected:
  9. virtual void paintCell(QPainter *painter, const QRect &rect, const QDate &date);
  10.  
  11. };
  12.  
  13. MyCalender::MyCalender(QWidget *parent): QCalendarWidget(parent)
  14. {
  15.  
  16. }
  17.  
  18. void MyCalender::paintCell(QPainter *painter, const QRect &rect, const QDate &date)
  19. {
  20.  
  21. if(date.dayOfWeek() == Qt::Monday)
  22. {
  23. painter->save();
  24. painter->fillRect(rect, Qt::green);
  25. painter->drawRect(rect);
  26. painter->drawText(rect, Qt::AlignCenter, QString::number(date.day()));
  27. painter->restore();
  28. }
  29. else
  30. {
  31. QCalendarWidget::paintCell(painter, rect, date);
  32. }
  33.  
  34. }
To copy to clipboard, switch view to plain text mode 

My Window:

Qt Code:
  1. class MyWindow: public QDialog
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6.  
  7. MyWindow(QWidget *parent = 0);
  8. ~MyWindow();
  9.  
  10. QString getFileName();
  11.  
  12. public slots:
  13. void colorADate(const QDate &date);
  14.  
  15. private:
  16. MyCalender *m_calendrier;
  17. };
  18.  
  19. void MyWindow::colorADate(const QDate &date)
  20. {
  21. QPainter *painter = new QPainter;
  22.  
  23. m_calendrier->paintCell(painter, rect, date);
  24.  
  25. }
To copy to clipboard, switch view to plain text mode