From 12ec0f5c2b39e85b4fbbba5b9ae354af0e850b6d Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Fri, 25 Jul 2008 15:20:12 +0000 Subject: [PATCH] Prevent a tooltip from showing after a user has clicked or scrolled on a widget (until it is re-entered) Also fixed a small whitespace issue. Back-port to 4.1 if so desired. :) svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=837733 --- tooltipmanager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tooltipmanager.cpp b/tooltipmanager.cpp index 102338d02..01820ce06 100644 --- a/tooltipmanager.cpp +++ b/tooltipmanager.cpp @@ -308,8 +308,8 @@ void ToolTipManagerPrivate::showToolTip() bool ToolTipManager::eventFilter(QObject *watched, QEvent *event) { QGraphicsWidget * widget = dynamic_cast(watched); - if (!widget) { - return QObject::eventFilter(watched,event); + if (!widget) { + return QObject::eventFilter(watched, event); } switch (event->type()) { @@ -320,6 +320,13 @@ bool ToolTipManager::eventFilter(QObject *watched, QEvent *event) break; } + // Don't restart the show timer on a mouse move event if there hasn't + // been an enter event or the current widget has been cleared by a click + // or wheel event. + if (!d->currentWidget) { + break; + } + case QEvent::GraphicsSceneHoverEnter: { // Check that there is a tooltip to show