tags:

views:

72

answers:

1

How can calendar widget's particular cells be coloured?

+1  A: 

Hey,

I think you should extend the QCalendar Class and add some behavior !

I've found something here : http://www.qtforum.org/article/21614/paintcell-and-qcalendarwidget.html#post79008

As you can see in the example, you could use something like :

QBrush brush;
brush.setColor( Qt::green );
QTextCharFormat cf = calendarWidget->dateTextFormat( date );
cf.setBackground( brush );
calendarWidget->setDateTextFormat( date, cf );

Hope it helps a bit!

Andy M