diff --git a/dictionarybar.cc b/dictionarybar.cc index 63738df7..a909cc7e 100644 --- a/dictionarybar.cc +++ b/dictionarybar.cc @@ -16,8 +16,7 @@ DictionaryBar::DictionaryBar( QWidget * parent, mutedDictionaries( 0 ), configEvents( events ), editDictionaryCommand( _editDictionaryCommand ), - maxDictionaryRefsInContextMenu(maxDictionaryRefsInContextMenu_), - timerId( 0 ) + maxDictionaryRefsInContextMenu(maxDictionaryRefsInContextMenu_) { setObjectName( "dictionaryBar" ); @@ -28,8 +27,6 @@ DictionaryBar::DictionaryBar( QWidget * parent, connect( this, SIGNAL(actionTriggered(QAction*)), this, SLOT(actionWasTriggered(QAction*)) ); - - installEventFilter( this ); } static QString elideDictName( QString const & name ) @@ -352,42 +349,3 @@ void DictionaryBar::dictsPaneClicked( const QString & id ) } } } - -bool DictionaryBar::eventFilter( QObject * obj, QEvent * ev ) -{ - if(obj == this && !isFloating() ) - { - QPoint pt = parentWidget()->mapFromGlobal( QCursor::pos() ); - switch( ev->type() ) - { - case QEvent::Leave : if( geometry().contains( pt ) ) - { - if( timerId ) - killTimer( timerId ); - timerId = startTimer( 500 ); - return true; - } - break; - case QEvent::Enter : if( timerId != 0) - { - killTimer( timerId ); - timerId = 0; - } - break; - case QEvent::Timer: if( static_cast< QTimerEvent * >( ev )->timerId() == timerId ) - { - if( !geometry().contains( pt ) ) - { - killTimer( timerId ); - timerId = 0; - QEvent event( QEvent::Leave ); - QApplication::sendEvent( this, &event ); - } - return true; - } - break; - default: break; - } - } - return false; -} diff --git a/dictionarybar.hh b/dictionarybar.hh index d108e381..2f886d24 100644 --- a/dictionarybar.hh +++ b/dictionarybar.hh @@ -61,10 +61,6 @@ private: QList< QAction * > dictActions; QAction * maxDictionaryRefsAction; - int timerId; - - virtual bool eventFilter( QObject *, QEvent * ); - protected: void contextMenuEvent( QContextMenuEvent * event );