UI: Use pipe operator instead of plus for Qt keys

master
gxalpha 2022-07-19 15:31:49 +02:00 committed by Ryan Foster
parent 17ba8359e4
commit 49e37db952
2 changed files with 10 additions and 10 deletions

View File

@ -956,7 +956,7 @@ void OBSBasicFilters::CustomContextMenu(const QPoint &pos, bool async)
QAction *copyAction = new QAction(QTStr("Copy"));
connect(copyAction, SIGNAL(triggered()), this,
SLOT(CopyFilter()));
copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
copyAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_C));
ui->effectWidget->addAction(copyAction);
ui->asyncWidget->addAction(copyAction);
popup.addAction(copyAction);
@ -965,7 +965,7 @@ void OBSBasicFilters::CustomContextMenu(const QPoint &pos, bool async)
QAction *pasteAction = new QAction(QTStr("Paste"));
pasteAction->setEnabled(main->copyFilter);
connect(pasteAction, SIGNAL(triggered()), this, SLOT(PasteFilter()));
pasteAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_V));
pasteAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_V));
ui->effectWidget->addAction(pasteAction);
ui->asyncWidget->addAction(pasteAction);
popup.addAction(pasteAction);

View File

@ -376,7 +376,7 @@ OBSBasic::OBSBasic(QWidget *parent)
#endif
#ifdef __linux__
ui->actionE_xit->setShortcut(Qt::CTRL + Qt::Key_Q);
ui->actionE_xit->setShortcut(Qt::CTRL | Qt::Key_Q);
#endif
auto addNudge = [this](const QKeySequence &seq, const char *s) {
@ -391,10 +391,10 @@ OBSBasic::OBSBasic(QWidget *parent)
addNudge(Qt::Key_Down, SLOT(NudgeDown()));
addNudge(Qt::Key_Left, SLOT(NudgeLeft()));
addNudge(Qt::Key_Right, SLOT(NudgeRight()));
addNudge(Qt::SHIFT + Qt::Key_Up, SLOT(NudgeUpFar()));
addNudge(Qt::SHIFT + Qt::Key_Down, SLOT(NudgeDownFar()));
addNudge(Qt::SHIFT + Qt::Key_Left, SLOT(NudgeLeftFar()));
addNudge(Qt::SHIFT + Qt::Key_Right, SLOT(NudgeRightFar()));
addNudge(Qt::SHIFT | Qt::Key_Up, SLOT(NudgeUpFar()));
addNudge(Qt::SHIFT | Qt::Key_Down, SLOT(NudgeDownFar()));
addNudge(Qt::SHIFT | Qt::Key_Left, SLOT(NudgeLeftFar()));
addNudge(Qt::SHIFT | Qt::Key_Right, SLOT(NudgeRightFar()));
assignDockToggle(ui->scenesDock, ui->toggleScenes);
assignDockToggle(ui->sourcesDock, ui->toggleSources);
@ -404,10 +404,10 @@ OBSBasic::OBSBasic(QWidget *parent)
assignDockToggle(statsDock, ui->toggleStats);
// Register shortcuts for Undo/Redo
ui->actionMainUndo->setShortcut(Qt::CTRL + Qt::Key_Z);
ui->actionMainUndo->setShortcut(Qt::CTRL | Qt::Key_Z);
QList<QKeySequence> shrt;
shrt << QKeySequence((Qt::CTRL | Qt::SHIFT) + Qt::Key_Z)
<< QKeySequence(Qt::CTRL + Qt::Key_Y);
shrt << QKeySequence((Qt::CTRL | Qt::SHIFT) | Qt::Key_Z)
<< QKeySequence(Qt::CTRL | Qt::Key_Y);
ui->actionMainRedo->setShortcuts(shrt);
ui->actionMainUndo->setShortcutContext(Qt::ApplicationShortcut);