From b71d33f2be2cd9ff7098b2afb2bb661b217e1b9b Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 10 Feb 2015 15:25:38 +0100 Subject: [PATCH] Unify when tooltips are shown and kept alive. A new tooltip would only be shown if it had content to show. However in the old code if the tooltip was already visible we would keep the tooltip alive and sync with empty contents regardless of whether we had anything to show. This seems to clear up the system tray where we have nested tooltip areas for the tray applet and the icon itself and things would flicker Change-Id: I7d9ded9edb70672c572e008c8d6f1ffe2d76b773 Changelog: Avoid showing an empty tooltip --- src/declarativeimports/core/tooltip.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp index 987dc96f6..76ae49f52 100644 --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -304,6 +304,9 @@ void ToolTip::hoverEnterEvent(QHoverEvent *event) return; } + if (!m_mainItem && mainText().isEmpty() && subText().isEmpty()) { + return; + } if (tooltipDialogInstance()->isVisible()) { // We signal the tooltipmanager that we're "potentially interested, // and ask to keep it open for a bit, so other items get the chance @@ -312,7 +315,7 @@ void ToolTip::hoverEnterEvent(QHoverEvent *event) tooltipDialogInstance()->keepalive(); //FIXME: showToolTip needs to be renamed in sync or something like that showToolTip(); - } else if (m_mainItem || !mainText().isEmpty() || !subText().isEmpty()) { + } else { m_showTimer->start(m_interval); } }