hide the label completely when no image is set. makes sure there isn't layout().spacing() extra padding

This commit is contained in:
Aaron Seigo 2011-11-30 15:19:29 +01:00
parent 7498fe207a
commit 3bf1d0d63d

View File

@ -300,7 +300,12 @@ void ToolTip::setContent(QObject *tipper, const ToolTipContent &data)
{
//reset our size
d->text->setContent(data);
d->imageLabel->setPixmap(data.image());
if (data.image().isNull()) {
d->imageLabel->hide();
} else {
d->imageLabel->show();
d->imageLabel->setPixmap(data.image());
}
if (data.highlightWindows() && !data.windowsToPreview().isEmpty()) {
WindowEffects::highlightWindows(winId(), QList<WId>() << winId() << data.windowsToPreview());