From e2a4129c303790236c05c7af11e6f29739fa010e Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 3 Oct 2020 11:58:52 +1000 Subject: [PATCH] Qt: Fix hitting enter on game list not launching game --- src/duckstation-qt/gamelistwidget.cpp | 8 ++++---- src/duckstation-qt/gamelistwidget.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index c733e8fbb..2ec75d705 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -68,7 +68,7 @@ void GameListWidget::initialize(QtHostInterface* host_interface) connect(m_table_view->selectionModel(), &QItemSelectionModel::currentChanged, this, &GameListWidget::onSelectionModelCurrentChanged); - connect(m_table_view, &QTableView::doubleClicked, this, &GameListWidget::onTableViewItemDoubleClicked); + connect(m_table_view, &QTableView::activated, this, &GameListWidget::onTableViewItemActivated); connect(m_table_view, &QTableView::customContextMenuRequested, this, &GameListWidget::onTableViewContextMenuRequested); connect(m_table_view->horizontalHeader(), &QHeaderView::customContextMenuRequested, this, @@ -94,7 +94,7 @@ void GameListWidget::initialize(QtHostInterface* host_interface) &GameListWidget::onSelectionModelCurrentChanged); connect(m_list_view, &GameListGridListView::zoomIn, this, &GameListWidget::gridZoomIn); connect(m_list_view, &GameListGridListView::zoomOut, this, &GameListWidget::gridZoomOut); - connect(m_list_view, &QListView::doubleClicked, this, &GameListWidget::onListViewItemDoubleClicked); + connect(m_list_view, &QListView::activated, this, &GameListWidget::onListViewItemActivated); connect(m_list_view, &QListView::customContextMenuRequested, this, &GameListWidget::onListViewContextMenuRequested); insertWidget(1, m_list_view); @@ -140,7 +140,7 @@ void GameListWidget::onSelectionModelCurrentChanged(const QModelIndex& current, emit entrySelected(&entry); } -void GameListWidget::onTableViewItemDoubleClicked(const QModelIndex& index) +void GameListWidget::onTableViewItemActivated(const QModelIndex& index) { const QModelIndex source_index = m_sort_model->mapToSource(index); if (!source_index.isValid() || source_index.row() >= static_cast(m_game_list->GetEntryCount())) @@ -159,7 +159,7 @@ void GameListWidget::onTableViewContextMenuRequested(const QPoint& point) emit entryContextMenuRequested(m_table_view->mapToGlobal(point), entry); } -void GameListWidget::onListViewItemDoubleClicked(const QModelIndex& index) +void GameListWidget::onListViewItemActivated(const QModelIndex& index) { const QModelIndex source_index = m_sort_model->mapToSource(index); if (!source_index.isValid() || source_index.row() >= static_cast(m_game_list->GetEntryCount())) diff --git a/src/duckstation-qt/gamelistwidget.h b/src/duckstation-qt/gamelistwidget.h index 64876ff01..a719a5b25 100644 --- a/src/duckstation-qt/gamelistwidget.h +++ b/src/duckstation-qt/gamelistwidget.h @@ -49,11 +49,11 @@ Q_SIGNALS: private Q_SLOTS: void onGameListRefreshed(); void onSelectionModelCurrentChanged(const QModelIndex& current, const QModelIndex& previous); - void onTableViewItemDoubleClicked(const QModelIndex& index); + void onTableViewItemActivated(const QModelIndex& index); void onTableViewContextMenuRequested(const QPoint& point); void onTableViewHeaderContextMenuRequested(const QPoint& point); void onTableViewHeaderSortIndicatorChanged(int, Qt::SortOrder); - void onListViewItemDoubleClicked(const QModelIndex& index); + void onListViewItemActivated(const QModelIndex& index); void onListViewContextMenuRequested(const QPoint& point); public Q_SLOTS: