PDA

View Full Version : Setting background Image in Selected cell In CalenderWidget



Anshuman
20th April 2011, 11:59
i hv tried this code in setting backgroundImage in a particular cell in CalenderWidget but an error occur..cn u please check the error..


void PainterApp::paintEvent(QPaintEvent *)
{
QPainter painter(this);
QRectF target(30.0, 40.0, 80.0, 60.0);
QRectF source(30.0, 40.0, 70.0, 40.0);
QImage image("C:/QTWork/back-icon.png");


painter.drawImage(target, image, source);

ui->calendarWidget->paintCell(painter,target,QDate::currentDate());

painter.end();
}
regards
Anshuman

high_flyer
21st April 2011, 09:14
error occur.
1. in such cases post what the error is.
2. Unless you are not posting from a cell phone, and your keyboard is fully functional, please don't use sms short writing, it is really annoying and is NOT cool!

I guess the error has to do with paintCell() being protected.
If so, read about C++ class inheritance, and what 'public' 'protected' and 'private' mean.