From 1fe4e538f08e707c03953876aad50b6ffad954df Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 8 Aug 2009 13:10:37 +0000 Subject: [PATCH] don't bother to draw the rect if the text bounding rect is empty svn path=/trunk/KDE/kdelibs/; revision=1008830 --- widgets/iconwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index cb7608766..14b071ac4 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -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;