Hi..
I have to draw some vertical bars in each date cell of qcalendarwidget.. so im using styleditemdelegates for that... by overriding paint method of it.. im drawing vertical bars in each cell.. but problem is.. when im focusing on the date(current date, selected date)......the back ground color masks all the bars..and the bars are not displaying.. some one help me.. so that my calendarwidget can show.. the bars i have drawn in delegate paint methode as like as its showing dates..
here is my code... for paint method



if(Qt::ForegroundRole)
{
QPoint pointv1,pointv2;
int cnt=0;
QPen oldpen=painter->pen();


if((index.row()>0&&index.row()<=6)&&(index.column()>0&&index.column()<=7))
{
painter->save();
QPen newpen;

newpen.setColor(QColor(220,220,220,255));
for(int i=(option.rect.left()+2);i<option.rect.right()
{
cnt++;
pointv1.setX(i);
pointv1.setY(option.rect.top()+29);

pointv2.setX(i);
pointv2.setY(option.rect.bottom());


if(cnt==3||cnt==6)
i=i+4;
else
i=i+3;
painter->setPen(newpen);
painter->setBrush(QBrush(QColor(220,220,220,255)));
painter->drawLine(pointv1,pointv2);
painter->restore();

}
cnt=0;

}
painter->setPen(oldpen);
}


QStyledItemDelegate:aint(painter, option, index);
}