]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tooltips/tooltipmanager.cpp
Move code for initializing and handling view extensions to the new class ViewExtensio...
[dolphin.git] / src / tooltips / tooltipmanager.cpp
index ae514f896dd53ee9c9d6f4826ab1af6937466ffc..fbb36aaf5b34203cc9c922caee07b8b5f925f312 100644 (file)
@@ -86,6 +86,7 @@ ToolTipManager::ToolTipManager(QAbstractItemView* parent,
             this, SLOT(hideTip()));
 
     m_view->viewport()->installEventFilter(this);
+    m_view->installEventFilter(this);
 }
 
 ToolTipManager::~ToolTipManager()
@@ -99,7 +100,16 @@ void ToolTipManager::hideTip()
 
 bool ToolTipManager::eventFilter(QObject* watched, QEvent* event)
 {
-    if ((watched == m_view->viewport()) && (event->type() == QEvent::Leave)) {
+    if (watched == m_view->viewport()) {
+        switch (event->type()) {
+        case QEvent::Leave:
+        case QEvent::MouseButtonPress:
+            hideToolTip();
+            break;
+        default:
+            break;
+        }
+    } else if ((watched == m_view) && (event->type() == QEvent::KeyPress)) {
         hideToolTip();
     }