diff --git a/src/libtomahawk/playlist/PlaylistView.cpp b/src/libtomahawk/playlist/PlaylistView.cpp index 595395d7c..5f6cd818f 100644 --- a/src/libtomahawk/playlist/PlaylistView.cpp +++ b/src/libtomahawk/playlist/PlaylistView.cpp @@ -77,38 +77,6 @@ PlaylistView::keyPressEvent( QKeyEvent* event ) } -bool -PlaylistView::eventFilter( QObject* obj, QEvent* event ) -{ - if ( event->type() == QEvent::DragEnter ) - { - QDragEnterEvent* e = static_cast(event); - dragEnterEvent( e ); - return true; - } - if ( event->type() == QEvent::DragMove ) - { - QDragMoveEvent* e = static_cast(event); - dragMoveEvent( e ); - return true; - } - if ( event->type() == QEvent::DragLeave ) - { - QDragLeaveEvent* e = static_cast(event); - dragLeaveEvent( e ); - return true; - } - if ( event->type() == QEvent::Drop ) - { - QDropEvent* e = static_cast(event); - dropEvent( e ); - return true; - } - - return QObject::eventFilter( obj, event ); -} - - QList PlaylistView::updaters() const { diff --git a/src/libtomahawk/playlist/PlaylistView.h b/src/libtomahawk/playlist/PlaylistView.h index 8bfe68f44..b929dc782 100644 --- a/src/libtomahawk/playlist/PlaylistView.h +++ b/src/libtomahawk/playlist/PlaylistView.h @@ -50,7 +50,6 @@ signals: protected: void keyPressEvent( QKeyEvent* event ); - bool eventFilter( QObject* obj, QEvent* event ); private slots: void onMenuTriggered( int action ); diff --git a/src/libtomahawk/playlist/TrackView.cpp b/src/libtomahawk/playlist/TrackView.cpp index d3f0e5871..ac8f32b71 100644 --- a/src/libtomahawk/playlist/TrackView.cpp +++ b/src/libtomahawk/playlist/TrackView.cpp @@ -474,6 +474,38 @@ TrackView::resizeEvent( QResizeEvent* event ) } +bool +TrackView::eventFilter( QObject* obj, QEvent* event ) +{ + if ( event->type() == QEvent::DragEnter ) + { + QDragEnterEvent* e = static_cast(event); + dragEnterEvent( e ); + return true; + } + if ( event->type() == QEvent::DragMove ) + { + QDragMoveEvent* e = static_cast(event); + dragMoveEvent( e ); + return true; + } + if ( event->type() == QEvent::DragLeave ) + { + QDragLeaveEvent* e = static_cast(event); + dragLeaveEvent( e ); + return true; + } + if ( event->type() == QEvent::Drop ) + { + QDropEvent* e = static_cast(event); + dropEvent( e ); + return true; + } + + return QObject::eventFilter( obj, event ); +} + + void TrackView::dragEnterEvent( QDragEnterEvent* event ) { diff --git a/src/libtomahawk/playlist/TrackView.h b/src/libtomahawk/playlist/TrackView.h index 74042485f..7ea641a64 100644 --- a/src/libtomahawk/playlist/TrackView.h +++ b/src/libtomahawk/playlist/TrackView.h @@ -106,6 +106,7 @@ signals: protected: virtual void resizeEvent( QResizeEvent* event ); + virtual bool eventFilter( QObject* obj, QEvent* event ); virtual void startDrag( Qt::DropActions supportedActions ); virtual void dragEnterEvent( QDragEnterEvent* event );