backport: don't draw the rectangle if there is no room for text

svn path=/branches/KDE/4.3/kdelibs/; revision=1008831
This commit is contained in:
Marco Martin 2009-08-08 13:12:29 +00:00
parent 7e39818ee2
commit 57494bd355

View File

@ -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;