Make pressing return in the library view the same as double clicking

This commit is contained in:
David Sansome 2010-07-31 17:29:52 +00:00
parent 51b5e7d607
commit a207a3def5
2 changed files with 13 additions and 0 deletions

View File

@ -316,3 +316,15 @@ void LibraryView::CopyToDevice() {
organise_dialog_->SetFilenames(filenames, size);
organise_dialog_->show();
}
void LibraryView::keyReleaseEvent(QKeyEvent* e) {
switch (e->key()) {
case Qt::Key_Enter:
case Qt::Key_Return:
if (currentIndex().isValid())
emit doubleClicked(currentIndex());
break;
}
QTreeView::keyReleaseEvent(e);
}

View File

@ -66,6 +66,7 @@ class LibraryView : public AutoExpandingTreeView {
void paintEvent(QPaintEvent* event);
void mouseReleaseEvent(QMouseEvent* e);
void contextMenuEvent(QContextMenuEvent* e);
void keyReleaseEvent(QKeyEvent* e);
private slots:
void Load();