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
This commit is contained in:
Jason Stubbs 2008-07-25 15:20:12 +00:00
parent bebd1cdc1c
commit 12ec0f5c2b

View File

@ -308,8 +308,8 @@ void ToolTipManagerPrivate::showToolTip()
bool ToolTipManager::eventFilter(QObject *watched, QEvent *event)
{
QGraphicsWidget * widget = dynamic_cast<QGraphicsWidget *>(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