don't bother to draw the rect if the text bounding rect is empty

svn path=/trunk/KDE/kdelibs/; revision=1008830
This commit is contained in:
Marco Martin 2009-08-08 13:10:37 +00:00
parent 32ac2f11fb
commit 1fe4e538f0

View File

@ -983,7 +983,8 @@ void IconWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
if (d->textBgColor != QColor() &&
!(d->text.isEmpty() && d->infoText.isEmpty())) {
!(d->text.isEmpty() && d->infoText.isEmpty()) &&
!textBoundingRect.isEmpty()) {
QRectF rect = textBoundingRect.adjusted(-2, -2, 4, 4);
painter->setPen(Qt::transparent);
QColor color = d->textBgColor;