diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp index c51708980e..0b8a122b55 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.cpp +++ b/Source/Core/DolphinQt2/GameList/GameList.cpp @@ -74,6 +74,10 @@ void GameList::MakeListView() m_list->setWordWrap(false); connect(m_list, &QTableView::customContextMenuRequested, this, &GameList::ShowContextMenu); + connect(m_list->selectionModel(), &QItemSelectionModel::selectionChanged, + [this](const QItemSelection&, const QItemSelection&) { + emit SelectionChanged(GetSelectedGame()); + }); m_list->setColumnHidden(GameListModel::COL_PLATFORM, !SConfig::GetInstance().m_showSystemColumn); m_list->setColumnHidden(GameListModel::COL_ID, !SConfig::GetInstance().m_showIDColumn); @@ -137,6 +141,10 @@ void GameList::MakeGridView() m_grid->setContextMenuPolicy(Qt::CustomContextMenu); m_grid->setFrameStyle(QFrame::NoFrame); connect(m_grid, &QTableView::customContextMenuRequested, this, &GameList::ShowContextMenu); + connect(m_grid->selectionModel(), &QItemSelectionModel::selectionChanged, + [this](const QItemSelection&, const QItemSelection&) { + emit SelectionChanged(GetSelectedGame()); + }); } void GameList::ShowContextMenu(const QPoint&) diff --git a/Source/Core/DolphinQt2/GameList/GameList.h b/Source/Core/DolphinQt2/GameList/GameList.h index e99b3147d6..e01d32f0ad 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.h +++ b/Source/Core/DolphinQt2/GameList/GameList.h @@ -32,6 +32,7 @@ signals: void EmulationStarted(); void EmulationStopped(); void NetPlayHost(const QString& game_id); + void SelectionChanged(QSharedPointer game_file); private: void ShowContextMenu(const QPoint&);