relayout the icon when changing the text and the icon is not visible

this avoid "funny" sizes when the icon is shown

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=840300
This commit is contained in:
Marco Martin 2008-07-31 20:50:15 +00:00
parent 4335bba59c
commit ea546d6b61

View File

@ -976,6 +976,10 @@ void Icon::setText(const QString& text)
d->text = text;
// cause a relayout
d->currentSize = QSizeF(-1, -1);
//try to relayout, needed if an icon was never shown before
if (!isVisible()) {
layoutIcons(new QStyleOptionGraphicsItem);
}
resize(sizeFromIconSize(d->iconSize.width()));
}
@ -989,6 +993,10 @@ void Icon::setInfoText(const QString& text)
d->infoText = text;
// cause a relayout
d->currentSize = QSizeF(-1, -1);
//try to relayout, needed if an icon was never shown before
if (!isVisible()) {
layoutIcons(new QStyleOptionGraphicsItem);
}
resize(sizeFromIconSize(d->iconSize.width()));
}