wagmare
27th May 2009, 12:04
hi friends,
normally using fillRect() we will fill the entire rect with some color ..
but if i want to fill RoundRect .. how can i use fillRect ..
my code
QRectF rect1(0, 0, 100, 50);
QRectF rect2(5, 5, 90, 40);
painter->setPen(QColor(160, 160, 160));
painter->setBrush(QColor(104, 104, 104));
painter->drawRoundRect(rect1);
painter->drawRoundRect(rect2);
painter->fillRect(7, 7, 86, 36, QColor(51, 51, 51));
but it showing a box inside the rect2 . how can i fill the entire rect2 with QColor ...
currently i change my code as
QRectF rect1(0, 0, 100, 50);
QRectF rect2(5, 5, 90, 40);
painter->setPen(QColor(160, 160, 160));
painter->setBrush(QColor(104, 104, 104));
painter->drawRoundRect(rect1);
painter->setBrush(QColor(51, 51, 51));
painter->drawRoundRect(rect2);
normally using fillRect() we will fill the entire rect with some color ..
but if i want to fill RoundRect .. how can i use fillRect ..
my code
QRectF rect1(0, 0, 100, 50);
QRectF rect2(5, 5, 90, 40);
painter->setPen(QColor(160, 160, 160));
painter->setBrush(QColor(104, 104, 104));
painter->drawRoundRect(rect1);
painter->drawRoundRect(rect2);
painter->fillRect(7, 7, 86, 36, QColor(51, 51, 51));
but it showing a box inside the rect2 . how can i fill the entire rect2 with QColor ...
currently i change my code as
QRectF rect1(0, 0, 100, 50);
QRectF rect2(5, 5, 90, 40);
painter->setPen(QColor(160, 160, 160));
painter->setBrush(QColor(104, 104, 104));
painter->drawRoundRect(rect1);
painter->setBrush(QColor(51, 51, 51));
painter->drawRoundRect(rect2);