@@ -1089,11 +1089,6 @@ void MainWindow::populateSaveStateMenu(std::string_view game_serial, QMenu* menu
10891089 add_slot (tr (" Global Save %1 (%2)" ), tr (" Global Save %1 (Empty)" ), empty_serial, static_cast <s32>(slot));
10901090}
10911091
1092- void MainWindow::onCheatsActionTriggered ()
1093- {
1094- m_ui.menuCheats ->exec (QCursor::pos ());
1095- }
1096-
10971092void MainWindow::onCheatsMenuAboutToShow ()
10981093{
10991094 m_ui.menuCheats ->clear ();
@@ -1121,7 +1116,7 @@ void MainWindow::onCheatsMenuAboutToShow()
11211116 return ;
11221117 }
11231118
1124- QMenu* apply_submenu = menu->addMenu (tr (" &Apply Cheat" ));
1119+ QMenu* const apply_submenu = menu->addMenu (tr (" &Apply Cheat" ));
11251120 QtUtils::StylePopupMenu (apply_submenu);
11261121 for (const QString& name : names)
11271122 {
@@ -1776,7 +1771,7 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point)
17761771 menu->addAction (tr (" Add Search Directory..." ),
17771772 [this ]() { getSettingsWindow ()->getGameListSettingsWidget ()->addSearchDirectory (this ); });
17781773
1779- menu->exec (point);
1774+ menu->popup (point);
17801775}
17811776
17821777void MainWindow::setGameListEntryCoverImage (const GameList::Entry* entry)
@@ -2142,7 +2137,7 @@ void MainWindow::onToolbarContextMenuRequested(const QPoint& pos)
21422137 action->setEnabled (show_labels);
21432138 connect (action, &QAction::toggled, this , &MainWindow::onViewToolbarLabelsBesideIconsActionToggled);
21442139
2145- QMenu* position_menu = menu->addMenu (tr (" Position" ));
2140+ QMenu* const position_menu = menu->addMenu (tr (" Position" ));
21462141 QtUtils::StylePopupMenu (position_menu);
21472142 for (const auto & [area, name] : s_toolbar_areas)
21482143 {
@@ -2165,7 +2160,7 @@ void MainWindow::onToolbarContextMenuRequested(const QPoint& pos)
21652160 continue ;
21662161 }
21672162
2168- QAction* menu_action = menu->addAction ((m_ui.*action_ptr)->text ());
2163+ QAction* const menu_action = menu->addAction ((m_ui.*action_ptr)->text ());
21692164 menu_action->setCheckable (true );
21702165 menu_action->setChecked (StringUtil::IsInStringList (active_buttons, name));
21712166 connect (menu_action, &QAction::toggled, this , [this , name](bool checked) {
@@ -2480,7 +2475,7 @@ void MainWindow::connectSignals()
24802475 connect (m_ui.actionStartDiscToolbar , &QAction::triggered, this , &MainWindow::onStartDiscActionTriggered);
24812476 connect (m_ui.actionStartBios , &QAction::triggered, this , &MainWindow::onStartBIOSActionTriggered);
24822477 connect (m_ui.actionResumeLastState , &QAction::triggered, g_emu_thread, &EmuThread::resumeSystemFromMostRecentState);
2483- connect (m_ui.actionChangeDisc , &QAction::triggered, [this ] { m_ui.menuChangeDisc ->exec (QCursor::pos ()); });
2478+ connect (m_ui.actionChangeDisc , &QAction::triggered, [this ] { m_ui.menuChangeDisc ->popup (QCursor::pos ()); });
24842479 connect (m_ui.actionChangeDiscFromFile , &QAction::triggered, this , &MainWindow::onChangeDiscFromFileActionTriggered);
24852480 connect (m_ui.actionChangeDiscFromDevice , &QAction::triggered, this ,
24862481 &MainWindow::onChangeDiscFromDeviceActionTriggered);
@@ -2490,7 +2485,7 @@ void MainWindow::connectSignals()
24902485 connect (m_ui.menuLoadState , &QMenu::aboutToShow, this , &MainWindow::onLoadStateMenuAboutToShow);
24912486 connect (m_ui.menuSaveState , &QMenu::aboutToShow, this , &MainWindow::onSaveStateMenuAboutToShow);
24922487 connect (m_ui.menuCheats , &QMenu::aboutToShow, this , &MainWindow::onCheatsMenuAboutToShow);
2493- connect (m_ui.actionCheatsToolbar , &QAction::triggered, this , &MainWindow::onCheatsActionTriggered );
2488+ connect (m_ui.actionCheatsToolbar , &QAction::triggered, [ this ] { m_ui. menuCheats -> popup ( QCursor::pos ()); } );
24942489 connect (m_ui.actionStartFullscreenUI , &QAction::triggered, this , &MainWindow::onStartFullscreenUITriggered);
24952490 connect (m_ui.actionStartFullscreenUI2 , &QAction::triggered, this , &MainWindow::onStartFullscreenUITriggered);
24962491 connect (m_ui.actionRemoveDisc , &QAction::triggered, this , &MainWindow::onRemoveDiscActionTriggered);
@@ -2508,8 +2503,8 @@ void MainWindow::connectSignals()
25082503 connect (m_ui.actionScreenshot , &QAction::triggered, g_emu_thread, &EmuThread::saveScreenshot);
25092504 connect (m_ui.actionScanForNewGames , &QAction::triggered, this , &MainWindow::onScanForNewGamesTriggered);
25102505 connect (m_ui.actionRescanAllGames , &QAction::triggered, this , [this ]() { refreshGameList (true ); });
2511- connect (m_ui.actionLoadState , &QAction::triggered, this , [this ]() { m_ui.menuLoadState ->exec (QCursor::pos ()); });
2512- connect (m_ui.actionSaveState , &QAction::triggered, this , [this ]() { m_ui.menuSaveState ->exec (QCursor::pos ()); });
2506+ connect (m_ui.actionLoadState , &QAction::triggered, this , [this ]() { m_ui.menuLoadState ->popup (QCursor::pos ()); });
2507+ connect (m_ui.actionSaveState , &QAction::triggered, this , [this ]() { m_ui.menuSaveState ->popup (QCursor::pos ()); });
25132508 connect (m_ui.actionExit , &QAction::triggered, this , &MainWindow::close);
25142509 connect (m_ui.actionFullscreen , &QAction::triggered, g_emu_thread, &EmuThread::toggleFullscreen);
25152510 connect (m_ui.actionSettings , &QAction::triggered, [this ]() { doSettings (); });
@@ -2886,7 +2881,7 @@ void MainWindow::onViewClearGameListBackgroundTriggered()
28862881void MainWindow::onSettingsTriggeredFromToolbar ()
28872882{
28882883 if (s_system_valid)
2889- m_settings_toolbar_menu->exec (QCursor::pos ());
2884+ m_settings_toolbar_menu->popup (QCursor::pos ());
28902885 else
28912886 doSettings ();
28922887}
0 commit comments