Merge pull request #3532 from rukai/enterOpenGame
Qt - Enter key opens selected game in the game list.
This commit is contained in:
commit
670a1c2694
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <QDesktopServices>
|
||||
#include <QHeaderView>
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
#include <QUrl>
|
||||
|
||||
|
@ -164,3 +165,10 @@ void GameList::ConsiderViewChange()
|
|||
setCurrentWidget(m_empty);
|
||||
}
|
||||
}
|
||||
void GameList::keyReleaseEvent(QKeyEvent* event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Return)
|
||||
emit GameSelected();
|
||||
else
|
||||
QStackedWidget::keyReleaseEvent(event);
|
||||
}
|
||||
|
|
|
@ -55,4 +55,6 @@ private:
|
|||
QTableView* m_table;
|
||||
QLabel* m_empty;
|
||||
bool m_prefer_table;
|
||||
protected:
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue