diff options
| author | Peter Penz <[email protected]> | 2009-08-29 09:42:21 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-08-29 09:42:21 +0000 |
| commit | c05395ef9a6f449bd96b4323d308b53d70cede99 (patch) | |
| tree | ee8b6db0d0b07a7439b95395cbce0429c17ef635 /src/tooltips/tooltipmanager.cpp | |
| parent | e1c74b05fdae664aa9211cba3afb7993b51ec23b (diff) | |
Move code for initializing and handling view extensions to the new class ViewExtensionsFactory. Beside making DolphinView less complex this will allow the column view to share the view extension code instead of (partly) duplicating it as it has been done before.
Currently only the tooltips- and filepreview-handling have been moved into ViewExtensionsFactory, a further cleanup will be done later.
svn path=/trunk/KDE/kdebase/apps/; revision=1016893
Diffstat (limited to 'src/tooltips/tooltipmanager.cpp')
| -rw-r--r-- | src/tooltips/tooltipmanager.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tooltips/tooltipmanager.cpp b/src/tooltips/tooltipmanager.cpp index ae514f896..fbb36aaf5 100644 --- a/src/tooltips/tooltipmanager.cpp +++ b/src/tooltips/tooltipmanager.cpp @@ -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(); } |
