From d1cdb6c7d227f72a5d02b30e7ac5eb848d1e7623 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 15:19:29 +0100 Subject: [PATCH] hide the label completely when no image is set. makes sure there isn't layout().spacing() extra padding --- private/tooltip.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/private/tooltip.cpp b/private/tooltip.cpp index 3be6d7a88..bd1a3a3fe 100644 --- a/private/tooltip.cpp +++ b/private/tooltip.cpp @@ -304,7 +304,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() << winId() << data.windowsToPreview());