Merge pull request #8652 from sonic2kk/qtshortcuts

Qt: Use Builtin QKeySequence Shortcuts
This commit is contained in:
Léo Lam 2020-03-15 15:07:47 +01:00 committed by GitHub
commit 19a46dd67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -82,8 +82,8 @@ GameList::GameList(QWidget* parent) : QStackedWidget(parent)
m_prefer_list = Settings::Instance().GetPreferredView();
ConsiderViewChange();
auto* zoom_in = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Plus), this);
auto* zoom_out = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Minus), this);
auto* zoom_in = new QShortcut(QKeySequence::ZoomIn, this);
auto* zoom_out = new QShortcut(QKeySequence::ZoomOut, this);
connect(zoom_in, &QShortcut::activated, this, &GameList::ZoomIn);
connect(zoom_out, &QShortcut::activated, this, &GameList::ZoomOut);

View File

@ -199,8 +199,7 @@ void MenuBar::AddDVDBackupMenu(QMenu* file_menu)
void MenuBar::AddFileMenu()
{
QMenu* file_menu = addMenu(tr("&File"));
m_open_action = file_menu->addAction(tr("&Open..."), this, &MenuBar::Open,
QKeySequence(Qt::CTRL + Qt::Key_O));
m_open_action = file_menu->addAction(tr("&Open..."), this, &MenuBar::Open, QKeySequence::Open);
file_menu->addSeparator();
@ -211,8 +210,8 @@ void MenuBar::AddFileMenu()
file_menu->addSeparator();
m_exit_action =
file_menu->addAction(tr("E&xit"), this, &MenuBar::Exit, QKeySequence(Qt::ALT + Qt::Key_F4));
m_exit_action = file_menu->addAction(tr("E&xit"), this, &MenuBar::Exit);
m_exit_action->setShortcuts({QKeySequence::Quit, QKeySequence(Qt::ALT + Qt::Key_F4)});
}
void MenuBar::AddToolsMenu()
@ -488,14 +487,14 @@ void MenuBar::AddViewMenu()
view_menu->addSeparator();
view_menu->addAction(tr("Purge Game List Cache"), this, &MenuBar::PurgeGameListCache);
view_menu->addSeparator();
view_menu->addAction(tr("Search"), this, &MenuBar::ShowSearch,
QKeySequence(Qt::CTRL + Qt::Key_F));
view_menu->addAction(tr("Search"), this, &MenuBar::ShowSearch, QKeySequence::Find);
}
void MenuBar::AddOptionsMenu()
{
QMenu* options_menu = addMenu(tr("&Options"));
options_menu->addAction(tr("Co&nfiguration"), this, &MenuBar::Configure);
options_menu->addAction(tr("Co&nfiguration"), this, &MenuBar::Configure,
QKeySequence::Preferences);
options_menu->addSeparator();
options_menu->addAction(tr("&Graphics Settings"), this, &MenuBar::ConfigureGraphics);
options_menu->addAction(tr("&Audio Settings"), this, &MenuBar::ConfigureAudio);