Skip to content

Commit

Permalink
Allow to remove tracks by pressing Delete key
Browse files Browse the repository at this point in the history
  • Loading branch information
ninomp committed Sep 27, 2021
1 parent 023482f commit be02cbb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,14 @@ void WTrackTableView::keyPressEvent(QKeyEvent* event) {
// causes a track to load since we allow in-line editing
// of table items in general
return;
} else if (event->key() == Qt::Key_Delete) {
QModelIndexList indices = selectionModel()->selectedRows();
if (indices.size() > 0) {
TrackModel* pTrackModel = getTrackModel();
if (pTrackModel) {
pTrackModel->removeTracks(indices);
}
}
} else {
QTableView::keyPressEvent(event);
}
Expand Down

0 comments on commit be02cbb

Please sign in to comment.