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