From 57494bd355454e02846b3d49aef8a3eeacc564fd Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 8 Aug 2009 13:12:29 +0000 Subject: [PATCH] backport: don't draw the rectangle if there is no room for text svn path=/branches/KDE/4.3/kdelibs/; revision=1008831 --- widgets/iconwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 53c0a7130..6adb6c2fd 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -984,7 +984,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;