diff --git a/src/libtomahawk/playlist/artistview.cpp b/src/libtomahawk/playlist/artistview.cpp index 49b1e1153..6b5cd225e 100644 --- a/src/libtomahawk/playlist/artistview.cpp +++ b/src/libtomahawk/playlist/artistview.cpp @@ -151,6 +151,20 @@ ArtistView::onItemActivated( const QModelIndex& index ) } } +void +ArtistView::keyPressEvent( QKeyEvent* event ) +{ + qDebug() << Q_FUNC_INFO; + QTreeView::keyPressEvent( event ); + + if ( !model() ) + return; + + if ( event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return ) + { + onItemActivated( currentIndex() ); + } +} void ArtistView::paintEvent( QPaintEvent* event ) diff --git a/src/libtomahawk/playlist/artistview.h b/src/libtomahawk/playlist/artistview.h index fe5db9c63..f4076a200 100644 --- a/src/libtomahawk/playlist/artistview.h +++ b/src/libtomahawk/playlist/artistview.h @@ -74,6 +74,7 @@ protected: virtual void resizeEvent( QResizeEvent* event ); void paintEvent( QPaintEvent* event ); + void keyPressEvent( QKeyEvent* event ); private slots: void onFilterChanged( const QString& filter );