Qt: Set focus to display window when starting

This commit is contained in:
Connor McLaughlin 2020-01-06 14:08:00 +10:00
parent 40e1b7af23
commit d61f12cb4e
2 changed files with 4 additions and 2 deletions

View file

@ -108,8 +108,8 @@ void MainWindow::setupAdditionalUi()
m_game_list_widget->initialize(m_host_interface); m_game_list_widget->initialize(m_host_interface);
m_ui.mainContainer->insertWidget(0, m_game_list_widget); m_ui.mainContainer->insertWidget(0, m_game_list_widget);
QWidget* display_widget = m_host_interface->createDisplayWidget(m_ui.mainContainer); m_display_widget = m_host_interface->createDisplayWidget(m_ui.mainContainer);
m_ui.mainContainer->insertWidget(1, display_widget); m_ui.mainContainer->insertWidget(1, m_display_widget);
m_ui.mainContainer->setCurrentIndex(0); m_ui.mainContainer->setCurrentIndex(0);
} }
@ -140,6 +140,7 @@ void MainWindow::switchToGameListView()
void MainWindow::switchToEmulationView() void MainWindow::switchToEmulationView()
{ {
m_ui.mainContainer->setCurrentIndex(1); m_ui.mainContainer->setCurrentIndex(1);
m_display_widget->setFocus();
} }
void MainWindow::connectSignals() void MainWindow::connectSignals()

View file

@ -50,6 +50,7 @@ private:
std::unique_ptr<GameList> m_game_list; std::unique_ptr<GameList> m_game_list;
GameListWidget* m_game_list_widget = nullptr; GameListWidget* m_game_list_widget = nullptr;
QWidget* m_display_widget = nullptr;
SettingsDialog* m_settings_dialog = nullptr; SettingsDialog* m_settings_dialog = nullptr;