]> cloud.milkyroute.net Git - dolphin.git/commitdiff
if the mouse is above an item and moved very fast outside the widget, no viewportEnte...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 16 Apr 2008 20:26:21 +0000 (20:26 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 16 Apr 2008 20:26:21 +0000 (20:26 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=797742

src/dolphincolumnwidget.cpp
src/dolphincolumnwidget.h
src/dolphindetailsview.cpp
src/dolphindetailsview.h
src/dolphiniconsview.cpp
src/dolphiniconsview.h

index e7993b975f08046f2aeccc1ebfd68375cfacc1a3..ee051ff1acb325a0c6ed1d6e8a14b3df320c4fd6 100644 (file)
@@ -373,6 +373,15 @@ void DolphinColumnWidget::wheelEvent(QWheelEvent* event)
     QListView::wheelEvent(event);
 }
 
+void DolphinColumnWidget::leaveEvent(QEvent* event)
+{
+    QListView::leaveEvent(event);
+    // 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_view->m_controller->emitViewportEntered();
+}
+
 void DolphinColumnWidget::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
 {
     QListView::selectionChanged(selected, deselected);
index 11acb6d0281d5686f8c355f916d15e7739d3fb70..e51ff5d97cbfda35333d6c9090fc5c359e2e996d 100644 (file)
@@ -115,6 +115,7 @@ protected:
     virtual void keyPressEvent(QKeyEvent* event);
     virtual void contextMenuEvent(QContextMenuEvent* event);
     virtual void wheelEvent(QWheelEvent* event);
+    virtual void leaveEvent(QEvent* event);
     virtual void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
 
 private slots:
index 470cafa1d1e15ceb3e7c46bb8aca9b5a11de9eab..aef034df176e3fce11100427a0295d9fe2b84d52 100644 (file)
@@ -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();
index 88471746d0435b98007ee0c15bed18b4036b9fd6..a92e113dd9041c8337a8a6c966a32476792b2d4a 100644 (file)
@@ -60,6 +60,7 @@ protected:
     virtual void resizeEvent(QResizeEvent* event);
     virtual void wheelEvent(QWheelEvent* event);
     virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous);
+    virtual bool eventFilter(QObject* watched, QEvent* event);
 
 private slots:
     /**
index 959f152f0dbec6522781a3c4b2a2f966e15389a8..7b9ddd6ac55485d3fafaa5650505d5905233ff3a 100644 (file)
@@ -276,6 +276,15 @@ void DolphinIconsView::showEvent(QShowEvent* event)
     KCategorizedView::showEvent(event);
 }
 
+void DolphinIconsView::leaveEvent(QEvent* event)
+{
+    KCategorizedView::leaveEvent(event);
+    // 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();
+}
+
 void DolphinIconsView::slotShowPreviewChanged()
 {
     const DolphinView* view = m_controller->dolphinView();
index c912b99f7c4102839d13d51834cf80ce47a1bac9..56d492ce1d301d5279b58bae3e3ccfe7b7efa084 100644 (file)
@@ -63,6 +63,7 @@ protected:
     virtual void keyPressEvent(QKeyEvent* event);
     virtual void wheelEvent(QWheelEvent* event);
     virtual void showEvent(QShowEvent* event);
+    virtual void leaveEvent(QEvent* event);
 
 private slots:
     void slotShowPreviewChanged();