Enter key opens selected game in the game list.

This commit is contained in:
rukai 2016-01-19 21:53:12 +11:00 committed by Rukai
parent 58b3552233
commit 704d9cbea5
2 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@
#include <QDesktopServices>
#include <QHeaderView>
#include <QKeyEvent>
#include <QMenu>
#include <QUrl>
@ -161,3 +162,10 @@ void GameList::ConsiderViewChange()
setCurrentWidget(m_empty);
}
}
void GameList::keyReleaseEvent(QKeyEvent* event)
{
if (event->key() == Qt::Key_Return)
emit GameSelected();
else
QStackedWidget::keyReleaseEvent(event);
}

View File

@ -52,4 +52,6 @@ private:
QTableView* m_table;
QLabel* m_empty;
bool m_prefer_table;
protected:
void keyReleaseEvent(QKeyEvent* event) override;
};