From eb36093c2c5a8782c7c7f6be92881c108c30a5b1 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 16 Apr 2008 20:26:21 +0000 Subject: if the mouse is above an item and moved very fast outside the widget, no viewportEntered() signal might be emitted although the mouse has been moved above the viewport svn path=/trunk/KDE/kdebase/apps/; revision=797742 --- src/dolphindetailsview.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/dolphindetailsview.cpp') diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 470cafa1d..aef034df1 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -134,6 +134,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr updateDecorationSize(); setFocus(); + viewport()->installEventFilter(this); connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), this, SLOT(updateFont())); @@ -363,6 +364,18 @@ void DolphinDetailsView::currentChanged(const QModelIndex& current, const QModel } } +bool DolphinDetailsView::eventFilter(QObject* watched, QEvent* event) +{ + if ((watched == viewport()) && (event->type() == QEvent::Leave)) { + // if the mouse is above an item and moved very fast outside the widget, + // no viewportEntered() signal might be emitted although the mouse has been moved + // above the viewport + m_controller->emitViewportEntered(); + } + + return QTreeView::eventFilter(watched, event); +} + void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting) { QHeaderView* headerView = header(); -- cgit v1.3