mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +02:00
* Activate item when pressing return / enter.
This commit is contained in:
@@ -81,7 +81,7 @@ void
|
||||
PlaylistView::keyPressEvent( QKeyEvent* event )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
QTreeView::keyPressEvent( event );
|
||||
TrackView::keyPressEvent( event );
|
||||
|
||||
if ( !model() )
|
||||
return;
|
||||
|
@@ -17,7 +17,7 @@ public:
|
||||
void setModel( TrackModel* model );
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent( QKeyEvent* event );
|
||||
void keyPressEvent( QKeyEvent* event );
|
||||
|
||||
private slots:
|
||||
void onCustomContextMenu( const QPoint& pos );
|
||||
|
@@ -144,6 +144,22 @@ TrackView::onItemActivated( const QModelIndex& index )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TrackView::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
|
||||
TrackView::onItemResized( const QModelIndex& index )
|
||||
{
|
||||
|
@@ -45,6 +45,7 @@ protected:
|
||||
virtual void dropEvent( QDropEvent* event );
|
||||
|
||||
void paintEvent( QPaintEvent* event );
|
||||
void keyPressEvent( QKeyEvent* event );
|
||||
|
||||
private slots:
|
||||
void onItemResized( const QModelIndex& index );
|
||||
|
Reference in New Issue
Block a user