Tooltips: Prevent cluttering when showing with effects

Task-number: QTCREATORBUG-2968
Reviewed-by: Alessandro Portale
This commit is contained in:
Leandro Melo
2011-02-09 16:58:54 +01:00
parent 91e04fbadc
commit 350eaa5029

View File

@@ -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;
}