From 350eaa502991f24a55b25434705f2af09685d358 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Wed, 9 Feb 2011 16:58:54 +0100 Subject: [PATCH] Tooltips: Prevent cluttering when showing with effects Task-number: QTCREATORBUG-2968 Reviewed-by: Alessandro Portale --- src/plugins/texteditor/tooltip/tooltip.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/tooltip/tooltip.cpp b/src/plugins/texteditor/tooltip/tooltip.cpp index e75a7476d82..c1dceac23a9 100644 --- a/src/plugins/texteditor/tooltip/tooltip.cpp +++ b/src/plugins/texteditor/tooltip/tooltip.cpp @@ -99,13 +99,21 @@ bool ToolTip::acceptShow(const TipContent &content, QPoint localPos = pos; if (w) localPos = w->mapFromGlobal(pos); - if (tipChanged(localPos, content, w)) { + if (tipChanged(localPos, content, w)) setUp(pos, content, w, rect); - } return false; } hideTipImmediately(); } +#if !defined(QT_NO_EFFECTS) && !defined(Q_WS_MAC) + // While the effect takes places it might be that although the widget is actually on + // screen the isVisible method doesn't return true. + else if (m_tip + && (QApplication::isEffectEnabled(Qt::UI_FadeTooltip) + || QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))) { + hideTipImmediately(); + } +#endif return true; }