From 51250cfb4a14e08f5b8789b7e65954777614d7be Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Wed, 9 Mar 2022 17:35:12 +0100 Subject: [PATCH] Use | rather than + for combining QFlags The plus operator is no longer available for flags in Qt6. --- .../integration/globalshortcuts_test.cpp | 10 ++--- .../integration/keyboard_layout_test.cpp | 4 +- autotests/integration/lockscreen.cpp | 4 +- .../integration/no_global_shortcuts_test.cpp | 4 +- .../integration/xdgshellclient_rules_test.cpp | 28 ++++++------ src/effects/desktopgrid/desktopgrid.cpp | 8 ++-- .../desktopgrid/desktopgrid_config.cpp | 4 +- src/effects/invert/invert.cpp | 12 ++--- src/effects/invert/invert_config.cpp | 8 ++-- src/effects/lookingglass/lookingglass.cpp | 18 ++++---- .../lookingglass/lookingglass_config.cpp | 12 ++--- src/effects/magnifier/magnifier.cpp | 18 ++++---- src/effects/magnifier/magnifier_config.cpp | 12 ++--- src/effects/mouseclick/mouseclick.cpp | 6 +-- src/effects/mouseclick/mouseclick_config.cpp | 4 +- src/effects/mousemark/mousemark.cpp | 12 ++--- src/effects/mousemark/mousemark_config.cpp | 8 ++-- .../overview/kcm/overvieweffectkcm.cpp | 2 +- src/effects/overview/overvieweffect.cpp | 4 +- src/effects/presentwindows/presentwindows.cpp | 24 +++++----- .../presentwindows/presentwindows_config.cpp | 12 ++--- src/effects/thumbnailaside/thumbnailaside.cpp | 6 +-- .../thumbnailaside/thumbnailaside_config.cpp | 4 +- src/effects/zoom/zoom.cpp | 30 ++++++------- src/effects/zoom/zoom_config.cpp | 36 +++++++-------- .../kwintabbox/kwintabboxconfigform.cpp | 16 +++---- src/keyboard_layout.cpp | 2 +- src/tabbox/tabbox.cpp | 8 ++-- src/useractions.cpp | 44 +++++++++---------- src/virtualdesktops.cpp | 16 +++---- 30 files changed, 188 insertions(+), 188 deletions(-) diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp index 7858cfc3c8..00e9ab8aa8 100644 --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -259,8 +259,8 @@ void GlobalShortcutsTest::testMetaShiftW() action->setObjectName(QStringLiteral("globalshortcuts-test-meta-shift-w")); QSignalSpy triggeredSpy(action.data(), &QAction::triggered); QVERIFY(triggeredSpy.isValid()); - KGlobalAccel::self()->setShortcut(action.data(), QList{Qt::META + Qt::SHIFT + Qt::Key_W}, KGlobalAccel::NoAutoloading); - input()->registerShortcut(Qt::META + Qt::SHIFT + Qt::Key_W, action.data()); + KGlobalAccel::self()->setShortcut(action.data(), QList{Qt::META | Qt::SHIFT | Qt::Key_W}, KGlobalAccel::NoAutoloading); + input()->registerShortcut(Qt::META | Qt::SHIFT | Qt::Key_W, action.data()); // press meta+shift+w quint32 timestamp = 0; @@ -343,7 +343,7 @@ void GlobalShortcutsTest::testX11ClientShortcut() QCOMPARE(workspace()->activeClient(), client); QVERIFY(client->isActive()); QCOMPARE(client->shortcut(), QKeySequence()); - const QKeySequence seq(Qt::META + Qt::SHIFT + Qt::Key_Y); + const QKeySequence seq(Qt::META | Qt::SHIFT | Qt::Key_Y); QVERIFY(workspace()->shortcutAvailable(seq)); client->setShortcut(seq.toString()); QCOMPARE(client->shortcut(), seq); @@ -385,7 +385,7 @@ void GlobalShortcutsTest::testWaylandClientShortcut() QCOMPARE(workspace()->activeClient(), client); QVERIFY(client->isActive()); QCOMPARE(client->shortcut(), QKeySequence()); - const QKeySequence seq(Qt::META + Qt::SHIFT + Qt::Key_Y); + const QKeySequence seq(Qt::META | Qt::SHIFT | Qt::Key_Y); QVERIFY(workspace()->shortcutAvailable(seq)); client->setShortcut(seq.toString()); QCOMPARE(client->shortcut(), seq); @@ -453,7 +453,7 @@ void GlobalShortcutsTest::testSetupWindowShortcut() // now send in enter kwinApp()->platform()->keyboardKeyPressed(KEY_ENTER, timestamp++); kwinApp()->platform()->keyboardKeyReleased(KEY_ENTER, timestamp++); - QTRY_COMPARE(client->shortcut(), QKeySequence(Qt::META + Qt::SHIFT + Qt::Key_Y)); + QTRY_COMPARE(client->shortcut(), QKeySequence(Qt::META | Qt::SHIFT | Qt::Key_Y)); } WAYLANDTEST_MAIN(GlobalShortcutsTest) diff --git a/autotests/integration/keyboard_layout_test.cpp b/autotests/integration/keyboard_layout_test.cpp index aca60e7b5d..ae41c8a5c8 100644 --- a/autotests/integration/keyboard_layout_test.cpp +++ b/autotests/integration/keyboard_layout_test.cpp @@ -257,12 +257,12 @@ void KeyboardLayoutTest::testPerLayoutShortcut() QAction *a = new QAction(this); a->setObjectName(QStringLiteral("Switch keyboard layout to English (US)")); a->setProperty("componentName", componentName); - KGlobalAccel::self()->setShortcut(a, QList{Qt::CTRL+Qt::ALT+Qt::Key_1}, KGlobalAccel::NoAutoloading); + KGlobalAccel::self()->setShortcut(a, QList{Qt::CTRL|Qt::ALT|Qt::Key_1}, KGlobalAccel::NoAutoloading); delete a; a = new QAction(this); a->setObjectName(QStringLiteral("Switch keyboard layout to German")); a->setProperty("componentName", componentName); - KGlobalAccel::self()->setShortcut(a, QList{Qt::CTRL+Qt::ALT+Qt::Key_2}, KGlobalAccel::NoAutoloading); + KGlobalAccel::self()->setShortcut(a, QList{Qt::CTRL|Qt::ALT|Qt::Key_2}, KGlobalAccel::NoAutoloading); delete a; // now we should have three layouts diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp index 1c0c16e28d..91f00565df 100644 --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -693,8 +693,8 @@ void LockScreenTest::testKeyboardShortcut() QVERIFY(actionSpy.isValid()); action->setProperty("componentName", QStringLiteral(KWIN_NAME)); action->setObjectName("LockScreenTest::testKeyboardShortcut"); - KGlobalAccel::self()->setDefaultShortcut(action.data(), QList{Qt::CTRL + Qt::META + Qt::ALT + Qt::Key_Space}); - KGlobalAccel::self()->setShortcut(action.data(), QList{Qt::CTRL + Qt::META + Qt::ALT + Qt::Key_Space}, + KGlobalAccel::self()->setDefaultShortcut(action.data(), QList{Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_Space}); + KGlobalAccel::self()->setShortcut(action.data(), QList{Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_Space}, KGlobalAccel::NoAutoloading); // try to trigger the shortcut diff --git a/autotests/integration/no_global_shortcuts_test.cpp b/autotests/integration/no_global_shortcuts_test.cpp index b0141178c5..bcb4b17923 100644 --- a/autotests/integration/no_global_shortcuts_test.cpp +++ b/autotests/integration/no_global_shortcuts_test.cpp @@ -176,8 +176,8 @@ void NoGlobalShortcutsTest::testKGlobalAccel() action->setObjectName(QStringLiteral("globalshortcuts-test-meta-shift-w")); QSignalSpy triggeredSpy(action.data(), &QAction::triggered); QVERIFY(triggeredSpy.isValid()); - KGlobalAccel::self()->setShortcut(action.data(), QList{Qt::META + Qt::SHIFT + Qt::Key_W}, KGlobalAccel::NoAutoloading); - input()->registerShortcut(Qt::META + Qt::SHIFT + Qt::Key_W, action.data()); + KGlobalAccel::self()->setShortcut(action.data(), QList{Qt::META | Qt::SHIFT | Qt::Key_W}, KGlobalAccel::NoAutoloading); + input()->registerShortcut(Qt::META | Qt::SHIFT | Qt::Key_W, action.data()); // press meta+shift+w quint32 timestamp = 0; diff --git a/autotests/integration/xdgshellclient_rules_test.cpp b/autotests/integration/xdgshellclient_rules_test.cpp index e09682210e..ad11b3e0a1 100644 --- a/autotests/integration/xdgshellclient_rules_test.cpp +++ b/autotests/integration/xdgshellclient_rules_test.cpp @@ -3019,7 +3019,7 @@ void TestXdgShellClientRules::testShortcutApply() QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); QVERIFY(clientUnminimizedSpy.isValid()); quint32 timestamp = 1; - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3033,7 +3033,7 @@ void TestXdgShellClientRules::testShortcutApply() // One can also change the shortcut. client->setShortcut(QStringLiteral("Ctrl+Alt+2")); - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_2})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3065,7 +3065,7 @@ void TestXdgShellClientRules::testShortcutApply() QVERIFY(client); // The window shortcut should be set back to Ctrl+Alt+1. - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); // Destroy the client. delete shellSurface; @@ -3090,7 +3090,7 @@ void TestXdgShellClientRules::testShortcutRemember() QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); QVERIFY(clientUnminimizedSpy.isValid()); quint32 timestamp = 1; - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3104,7 +3104,7 @@ void TestXdgShellClientRules::testShortcutRemember() // Change the window shortcut to Ctrl+Alt+2. client->setShortcut(QStringLiteral("Ctrl+Alt+2")); - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_2})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3124,7 +3124,7 @@ void TestXdgShellClientRules::testShortcutRemember() QVERIFY(client); // The window shortcut should be set to the last known value. - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_2})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2})); // Destroy the client. delete shellSurface; @@ -3149,7 +3149,7 @@ void TestXdgShellClientRules::testShortcutForce() QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); QVERIFY(clientUnminimizedSpy.isValid()); quint32 timestamp = 1; - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3163,7 +3163,7 @@ void TestXdgShellClientRules::testShortcutForce() // Any attempt to change the window shortcut should not succeed. client->setShortcut(QStringLiteral("Ctrl+Alt+2")); - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3183,7 +3183,7 @@ void TestXdgShellClientRules::testShortcutForce() QVERIFY(client); // The window shortcut should still be forced. - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); // Destroy the client. delete shellSurface; @@ -3204,7 +3204,7 @@ void TestXdgShellClientRules::testShortcutApplyNow() setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::ApplyNow)); // The client should now have a window shortcut assigned. - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); QVERIFY(clientUnminimizedSpy.isValid()); quint32 timestamp = 1; @@ -3221,7 +3221,7 @@ void TestXdgShellClientRules::testShortcutApplyNow() // Assign a different shortcut. client->setShortcut(QStringLiteral("Ctrl+Alt+2")); - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_2})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3235,7 +3235,7 @@ void TestXdgShellClientRules::testShortcutApplyNow() // The rule should not be applied again. client->evaluateWindowRules(); - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_2})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2})); // Destroy the client. delete shellSurface; @@ -3260,7 +3260,7 @@ void TestXdgShellClientRules::testShortcutForceTemporarily() QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); QVERIFY(clientUnminimizedSpy.isValid()); quint32 timestamp = 1; - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); @@ -3274,7 +3274,7 @@ void TestXdgShellClientRules::testShortcutForceTemporarily() // Any attempt to change the window shortcut should not succeed. client->setShortcut(QStringLiteral("Ctrl+Alt+2")); - QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); + QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1})); client->minimize(); QVERIFY(client->isMinimized()); kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); diff --git a/src/effects/desktopgrid/desktopgrid.cpp b/src/effects/desktopgrid/desktopgrid.cpp index 650b71eb94..4f02968ecc 100644 --- a/src/effects/desktopgrid/desktopgrid.cpp +++ b/src/effects/desktopgrid/desktopgrid.cpp @@ -115,10 +115,10 @@ DesktopGridEffect::DesktopGridEffect() s->setObjectName(QStringLiteral("ShowDesktopGrid")); s->setText(i18n("Show Desktop Grid")); - KGlobalAccel::self()->setDefaultShortcut(s, QList() << Qt::CTRL + Qt::Key_F8); - KGlobalAccel::self()->setShortcut(s, QList() << Qt::CTRL + Qt::Key_F8); + KGlobalAccel::self()->setDefaultShortcut(s, QList() << (Qt::CTRL | Qt::Key_F8)); + KGlobalAccel::self()->setShortcut(s, QList() << (Qt::CTRL | Qt::Key_F8)); shortcut = KGlobalAccel::self()->shortcut(s); - effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F8, s); + effects->registerGlobalShortcut(Qt::CTRL | Qt::Key_F8, s); connect(s, &QAction::triggered, this, &DesktopGridEffect::toggle); @@ -750,7 +750,7 @@ void DesktopGridEffect::grabbedKeyboardEvent(QKeyEvent* e) if (e->type() == QEvent::KeyPress) { // check for global shortcuts // HACK: keyboard grab disables the global shortcuts so we have to check for global shortcut (bug 156155) - if (shortcut.contains(e->key() + e->modifiers())) { + if (shortcut.contains(e->key() | e->modifiers())) { deactivate(); return; } diff --git a/src/effects/desktopgrid/desktopgrid_config.cpp b/src/effects/desktopgrid/desktopgrid_config.cpp index 14042ce551..6c900909f9 100644 --- a/src/effects/desktopgrid/desktopgrid_config.cpp +++ b/src/effects/desktopgrid/desktopgrid_config.cpp @@ -53,8 +53,8 @@ DesktopGridEffectConfig::DesktopGridEffectConfig(QWidget* parent, const QVariant QAction* a = m_actionCollection->addAction(QStringLiteral("ShowDesktopGrid")); a->setText(i18n("Show Desktop Grid")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::CTRL + Qt::Key_F8); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::Key_F8); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::CTRL | Qt::Key_F8)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::CTRL | Qt::Key_F8)); m_ui->shortcutEditor->addCollection(m_actionCollection); diff --git a/src/effects/invert/invert.cpp b/src/effects/invert/invert.cpp index 25f3dcbd57..b64fc1b6fb 100644 --- a/src/effects/invert/invert.cpp +++ b/src/effects/invert/invert.cpp @@ -40,17 +40,17 @@ InvertEffect::InvertEffect() QAction* a = new QAction(this); a->setObjectName(QStringLiteral("Invert")); a->setText(i18n("Toggle Invert Effect")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); - effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_I, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::CTRL | Qt::META | Qt::Key_I)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::CTRL | Qt::META | Qt::Key_I)); + effects->registerGlobalShortcut(Qt::CTRL | Qt::META | Qt::Key_I, a); connect(a, &QAction::triggered, this, &InvertEffect::toggleScreenInversion); QAction* b = new QAction(this); b->setObjectName(QStringLiteral("InvertWindow")); b->setText(i18n("Toggle Invert Effect on Window")); - KGlobalAccel::self()->setDefaultShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); - KGlobalAccel::self()->setShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); - effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_U, b); + KGlobalAccel::self()->setDefaultShortcut(b, QList() << (Qt::CTRL | Qt::META | Qt::Key_U)); + KGlobalAccel::self()->setShortcut(b, QList() << (Qt::CTRL | Qt::META | Qt::Key_U)); + effects->registerGlobalShortcut(Qt::CTRL | Qt::META | Qt::Key_U, b); connect(b, &QAction::triggered, this, &InvertEffect::toggleWindow); connect(effects, &EffectsHandler::windowClosed, this, &InvertEffect::slotWindowClosed); diff --git a/src/effects/invert/invert_config.cpp b/src/effects/invert/invert_config.cpp index dfb815b005..2470a82a85 100644 --- a/src/effects/invert/invert_config.cpp +++ b/src/effects/invert/invert_config.cpp @@ -37,14 +37,14 @@ InvertEffectConfig::InvertEffectConfig(QWidget* parent, const QVariantList& args QAction* a = actionCollection->addAction(QStringLiteral("Invert")); a->setText(i18n("Toggle Invert Effect")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::CTRL | Qt::META | Qt::Key_I)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::CTRL | Qt::META | Qt::Key_I)); QAction* b = actionCollection->addAction(QStringLiteral("InvertWindow")); b->setText(i18n("Toggle Invert Effect on Window")); b->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); - KGlobalAccel::self()->setShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); + KGlobalAccel::self()->setDefaultShortcut(b, QList() << (Qt::CTRL | Qt::META | Qt::Key_U)); + KGlobalAccel::self()->setShortcut(b, QList() << (Qt::CTRL | Qt::META | Qt::Key_U)); mShortcutEditor = new KShortcutsEditor(actionCollection, this, KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed); diff --git a/src/effects/lookingglass/lookingglass.cpp b/src/effects/lookingglass/lookingglass.cpp index e40661ad32..4c441378e0 100644 --- a/src/effects/lookingglass/lookingglass.cpp +++ b/src/effects/lookingglass/lookingglass.cpp @@ -53,19 +53,19 @@ LookingGlassEffect::LookingGlassEffect() initConfig(); QAction* a; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); - effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_Equal, a); a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); - effects->registerGlobalShortcut(Qt::META + Qt::Key_Minus, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_Minus, a); a = KStandardAction::actualSize(this, SLOT(toggle()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); - effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_0, a); connect(effects, &EffectsHandler::mouseChanged, this, &LookingGlassEffect::slotMouseChanged); connect(effects, &EffectsHandler::windowDamaged, this, &LookingGlassEffect::slotWindowDamaged); diff --git a/src/effects/lookingglass/lookingglass_config.cpp b/src/effects/lookingglass/lookingglass_config.cpp index c868102fc2..d7b77c1c5b 100644 --- a/src/effects/lookingglass/lookingglass_config.cpp +++ b/src/effects/lookingglass/lookingglass_config.cpp @@ -59,18 +59,18 @@ LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVaria QAction* a; a = m_actionCollection->addAction(KStandardAction::ZoomIn); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); a = m_actionCollection->addAction(KStandardAction::ZoomOut); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); a = m_actionCollection->addAction(KStandardAction::ActualSize); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); m_ui->editor->addCollection(m_actionCollection); } diff --git a/src/effects/magnifier/magnifier.cpp b/src/effects/magnifier/magnifier.cpp index 4dad0869c8..8e35ff6987 100644 --- a/src/effects/magnifier/magnifier.cpp +++ b/src/effects/magnifier/magnifier.cpp @@ -36,19 +36,19 @@ MagnifierEffect::MagnifierEffect() initConfig(); QAction* a; a = KStandardAction::zoomIn(this, &MagnifierEffect::zoomIn, this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); - effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_Equal, a); a = KStandardAction::zoomOut(this, &MagnifierEffect::zoomOut, this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); - effects->registerGlobalShortcut(Qt::META + Qt::Key_Minus, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_Minus, a); a = KStandardAction::actualSize(this, &MagnifierEffect::toggle, this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); - effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_0, a); connect(effects, &EffectsHandler::mouseChanged, this, &MagnifierEffect::slotMouseChanged); connect(effects, &EffectsHandler::windowDamaged, this, &MagnifierEffect::slotWindowDamaged); diff --git a/src/effects/magnifier/magnifier_config.cpp b/src/effects/magnifier/magnifier_config.cpp index 98f8b0d570..46ae3744cf 100644 --- a/src/effects/magnifier/magnifier_config.cpp +++ b/src/effects/magnifier/magnifier_config.cpp @@ -59,18 +59,18 @@ MagnifierEffectConfig::MagnifierEffectConfig(QWidget* parent, const QVariantList QAction* a; a = m_actionCollection->addAction(KStandardAction::ZoomIn); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); a = m_actionCollection->addAction(KStandardAction::ZoomOut); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); a = m_actionCollection->addAction(KStandardAction::ActualSize); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); m_ui->editor->addCollection(m_actionCollection); } diff --git a/src/effects/mouseclick/mouseclick.cpp b/src/effects/mouseclick/mouseclick.cpp index 7de5321a2d..96b8bc6416 100644 --- a/src/effects/mouseclick/mouseclick.cpp +++ b/src/effects/mouseclick/mouseclick.cpp @@ -32,9 +32,9 @@ MouseClickEffect::MouseClickEffect() QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ToggleMouseClick")); a->setText(i18n("Toggle Mouse Click Effect")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Asterisk); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Asterisk); - effects->registerGlobalShortcut(Qt::META + Qt::Key_Asterisk, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Asterisk)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Asterisk)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_Asterisk, a); connect(a, &QAction::triggered, this, &MouseClickEffect::toggleEnabled); reconfigure(ReconfigureAll); diff --git a/src/effects/mouseclick/mouseclick_config.cpp b/src/effects/mouseclick/mouseclick_config.cpp index 7896619b70..51585f5fb0 100644 --- a/src/effects/mouseclick/mouseclick_config.cpp +++ b/src/effects/mouseclick/mouseclick_config.cpp @@ -49,8 +49,8 @@ MouseClickEffectConfig::MouseClickEffectConfig(QWidget* parent, const QVariantLi QAction* a = m_actionCollection->addAction(QStringLiteral("ToggleMouseClick")); a->setText(i18n("Toggle Mouse Click Effect")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Asterisk); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Asterisk); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Asterisk)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Asterisk)); m_ui->editor->addCollection(m_actionCollection); diff --git a/src/effects/mousemark/mousemark.cpp b/src/effects/mousemark/mousemark.cpp index 824186273d..1175f44fad 100644 --- a/src/effects/mousemark/mousemark.cpp +++ b/src/effects/mousemark/mousemark.cpp @@ -34,16 +34,16 @@ MouseMarkEffect::MouseMarkEffect() QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ClearMouseMarks")); a->setText(i18n("Clear All Mouse Marks")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F11); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F11); - effects->registerGlobalShortcut(Qt::SHIFT + Qt::META + Qt::Key_F11, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F11)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F11)); + effects->registerGlobalShortcut(Qt::SHIFT | Qt::META | Qt::Key_F11, a); connect(a, &QAction::triggered, this, &MouseMarkEffect::clear); a = new QAction(this); a->setObjectName(QStringLiteral("ClearLastMouseMark")); a->setText(i18n("Clear Last Mouse Mark")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F12); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F12); - effects->registerGlobalShortcut(Qt::SHIFT + Qt::META + Qt::Key_F12, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F12)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F12)); + effects->registerGlobalShortcut(Qt::SHIFT | Qt::META | Qt::Key_F12, a); connect(a, &QAction::triggered, this, &MouseMarkEffect::clearLast); connect(effects, &EffectsHandler::mouseChanged, this, &MouseMarkEffect::slotMouseChanged); diff --git a/src/effects/mousemark/mousemark_config.cpp b/src/effects/mousemark/mousemark_config.cpp index bba3222893..502d287fbc 100644 --- a/src/effects/mousemark/mousemark_config.cpp +++ b/src/effects/mousemark/mousemark_config.cpp @@ -53,14 +53,14 @@ MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList QAction* a = m_actionCollection->addAction(QStringLiteral("ClearMouseMarks")); a->setText(i18n("Clear Mouse Marks")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F11); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F11); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F11)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F11)); a = m_actionCollection->addAction(QStringLiteral("ClearLastMouseMark")); a->setText(i18n("Clear Last Mouse Mark")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F12); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F12); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F12)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::SHIFT | Qt::META | Qt::Key_F12)); m_ui->editor->addCollection(m_actionCollection); diff --git a/src/effects/overview/kcm/overvieweffectkcm.cpp b/src/effects/overview/kcm/overvieweffectkcm.cpp index 30b9bd2c1d..ac514fc2b9 100644 --- a/src/effects/overview/kcm/overvieweffectkcm.cpp +++ b/src/effects/overview/kcm/overvieweffectkcm.cpp @@ -35,7 +35,7 @@ OverviewEffectConfig::OverviewEffectConfig(QWidget *parent, const QVariantList & actionCollection->setConfigGroup(QStringLiteral("Overview")); actionCollection->setConfigGlobal(true); - const QKeySequence defaultToggleShortcut = Qt::META + Qt::Key_W; + const QKeySequence defaultToggleShortcut = Qt::META | Qt::Key_W; QAction *toggleAction = actionCollection->addAction(QStringLiteral("Overview")); toggleAction->setText(i18n("Toggle Overview")); toggleAction->setProperty("isConfigurationAction", true); diff --git a/src/effects/overview/overvieweffect.cpp b/src/effects/overview/overvieweffect.cpp index 35968d088e..c22e2885a8 100644 --- a/src/effects/overview/overvieweffect.cpp +++ b/src/effects/overview/overvieweffect.cpp @@ -30,7 +30,7 @@ OverviewEffect::OverviewEffect() m_shutdownTimer->setSingleShot(true); connect(m_shutdownTimer, &QTimer::timeout, this, &OverviewEffect::realDeactivate); - const QKeySequence defaultToggleShortcut = Qt::META + Qt::Key_W; + const QKeySequence defaultToggleShortcut = Qt::META | Qt::Key_W; m_toggleAction = new QAction(this); connect(m_toggleAction, &QAction::triggered, this, &OverviewEffect::toggle); m_toggleAction->setObjectName(QStringLiteral("Overview")); @@ -182,7 +182,7 @@ void OverviewEffect::quickDeactivate() void OverviewEffect::grabbedKeyboardEvent(QKeyEvent *keyEvent) { - if (m_toggleShortcut.contains(keyEvent->key() + keyEvent->modifiers())) { + if (m_toggleShortcut.contains(keyEvent->key() | keyEvent->modifiers())) { if (keyEvent->type() == QEvent::KeyPress) { toggle(); } diff --git a/src/effects/presentwindows/presentwindows.cpp b/src/effects/presentwindows/presentwindows.cpp index 3a29bc0e6f..bf161c89b2 100644 --- a/src/effects/presentwindows/presentwindows.cpp +++ b/src/effects/presentwindows/presentwindows.cpp @@ -68,28 +68,28 @@ PresentWindowsEffect::PresentWindowsEffect() QAction* exposeAction = m_exposeAction; exposeAction->setObjectName(QStringLiteral("Expose")); exposeAction->setText(i18n("Toggle Present Windows (Current desktop)")); - KGlobalAccel::self()->setDefaultShortcut(exposeAction, QList() << Qt::CTRL + Qt::Key_F9); - KGlobalAccel::self()->setShortcut(exposeAction, QList() << Qt::CTRL + Qt::Key_F9); + KGlobalAccel::self()->setDefaultShortcut(exposeAction, QList() << (Qt::CTRL | Qt::Key_F9)); + KGlobalAccel::self()->setShortcut(exposeAction, QList() << (Qt::CTRL | Qt::Key_F9)); shortcut = KGlobalAccel::self()->shortcut(exposeAction); - effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F9, exposeAction); + effects->registerGlobalShortcut(Qt::CTRL | Qt::Key_F9, exposeAction); connect(exposeAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActive); QAction* exposeAllAction = m_exposeAllAction; exposeAllAction->setObjectName(QStringLiteral("ExposeAll")); exposeAllAction->setText(i18n("Toggle Present Windows (All desktops)")); - KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); - KGlobalAccel::self()->setShortcut(exposeAllAction, QList() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); + KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC); + KGlobalAccel::self()->setShortcut(exposeAllAction, QList() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC); shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction); - effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, exposeAllAction); + effects->registerGlobalShortcut(Qt::CTRL | Qt::Key_F10, exposeAllAction); effects->registerTouchpadSwipeShortcut(SwipeDirection::Down, exposeAllAction); connect(exposeAllAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveAllDesktops); QAction* exposeClassAction = m_exposeClassAction; exposeClassAction->setObjectName(QStringLiteral("ExposeClass")); exposeClassAction->setText(i18n("Toggle Present Windows (Window class)")); - KGlobalAccel::self()->setDefaultShortcut(exposeClassAction, QList() << Qt::CTRL + Qt::Key_F7); - KGlobalAccel::self()->setShortcut(exposeClassAction, QList() << Qt::CTRL + Qt::Key_F7); - effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F7, exposeClassAction); + KGlobalAccel::self()->setDefaultShortcut(exposeClassAction, QList() << (Qt::CTRL | Qt::Key_F7)); + KGlobalAccel::self()->setShortcut(exposeClassAction, QList() << (Qt::CTRL | Qt::Key_F7)); + effects->registerGlobalShortcut(Qt::CTRL | Qt::Key_F7, exposeClassAction); connect(exposeClassAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveClass); shortcutClass = KGlobalAccel::self()->shortcut(exposeClassAction); connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &PresentWindowsEffect::globalShortcutChanged); @@ -795,15 +795,15 @@ void PresentWindowsEffect::grabbedKeyboardEvent(QKeyEvent *e) if (e->type() == QEvent::KeyPress) { // check for global shortcuts // HACK: keyboard grab disables the global shortcuts so we have to check for global shortcut (bug 156155) - if (m_mode == ModeCurrentDesktop && shortcut.contains(e->key() + e->modifiers())) { + if (m_mode == ModeCurrentDesktop && shortcut.contains(e->key() | e->modifiers())) { toggleActive(); return; } - if (m_mode == ModeAllDesktops && shortcutAll.contains(e->key() + e->modifiers())) { + if (m_mode == ModeAllDesktops && shortcutAll.contains(e->key() | e->modifiers())) { toggleActiveAllDesktops(); return; } - if (m_mode == ModeWindowClass && shortcutClass.contains(e->key() + e->modifiers())) { + if (m_mode == ModeWindowClass && shortcutClass.contains(e->key() | e->modifiers())) { toggleActiveClass(); return; } diff --git a/src/effects/presentwindows/presentwindows_config.cpp b/src/effects/presentwindows/presentwindows_config.cpp index 1e3cc592c1..b2b96b9bff 100644 --- a/src/effects/presentwindows/presentwindows_config.cpp +++ b/src/effects/presentwindows/presentwindows_config.cpp @@ -52,20 +52,20 @@ PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QV QAction* a = m_actionCollection->addAction(QStringLiteral("ExposeAll")); a->setText(i18n("Toggle Present Windows (All desktops)")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC); QAction* b = m_actionCollection->addAction(QStringLiteral("Expose")); b->setText(i18n("Toggle Present Windows (Current desktop)")); b->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(b, QList() << Qt::CTRL + Qt::Key_F9); - KGlobalAccel::self()->setShortcut(b, QList() << Qt::CTRL + Qt::Key_F9); + KGlobalAccel::self()->setDefaultShortcut(b, QList() << (Qt::CTRL | Qt::Key_F9)); + KGlobalAccel::self()->setShortcut(b, QList() << (Qt::CTRL | Qt::Key_F9)); QAction* c = m_actionCollection->addAction(QStringLiteral("ExposeClass")); c->setText(i18n("Toggle Present Windows (Window class)")); c->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(c, QList() << Qt::CTRL + Qt::Key_F7); - KGlobalAccel::self()->setShortcut(c, QList() << Qt::CTRL + Qt::Key_F7); + KGlobalAccel::self()->setDefaultShortcut(c, QList() << (Qt::CTRL | Qt::Key_F7)); + KGlobalAccel::self()->setShortcut(c, QList() << (Qt::CTRL | Qt::Key_F7)); m_ui->shortcutEditor->addCollection(m_actionCollection); diff --git a/src/effects/thumbnailaside/thumbnailaside.cpp b/src/effects/thumbnailaside/thumbnailaside.cpp index 4ad6bb489c..d660721b56 100644 --- a/src/effects/thumbnailaside/thumbnailaside.cpp +++ b/src/effects/thumbnailaside/thumbnailaside.cpp @@ -27,9 +27,9 @@ ThumbnailAsideEffect::ThumbnailAsideEffect() QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ToggleCurrentThumbnail")); a->setText(i18n("Toggle Thumbnail for Current Window")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_T); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_T); - effects->registerGlobalShortcut(Qt::META + Qt::CTRL + Qt::Key_T, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_T)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_T)); + effects->registerGlobalShortcut(Qt::META | Qt::CTRL | Qt::Key_T, a); connect(a, &QAction::triggered, this, &ThumbnailAsideEffect::toggleCurrentThumbnail); connect(effects, &EffectsHandler::windowClosed, this, &ThumbnailAsideEffect::slotWindowClosed); diff --git a/src/effects/thumbnailaside/thumbnailaside_config.cpp b/src/effects/thumbnailaside/thumbnailaside_config.cpp index 886f4b8edc..6a3ea0810e 100644 --- a/src/effects/thumbnailaside/thumbnailaside_config.cpp +++ b/src/effects/thumbnailaside/thumbnailaside_config.cpp @@ -58,8 +58,8 @@ ThumbnailAsideEffectConfig::ThumbnailAsideEffectConfig(QWidget* parent, const QV QAction* a = m_actionCollection->addAction(QStringLiteral("ToggleCurrentThumbnail")); a->setText(i18n("Toggle Thumbnail for Current Window")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_T); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_T); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_T)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_T)); m_ui->editor->addCollection(m_actionCollection); } diff --git a/src/effects/zoom/zoom.cpp b/src/effects/zoom/zoom.cpp index cbfed0175a..d1d9589b86 100644 --- a/src/effects/zoom/zoom.cpp +++ b/src/effects/zoom/zoom.cpp @@ -47,21 +47,21 @@ ZoomEffect::ZoomEffect() initConfig(); QAction* a = nullptr; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); - effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_Equal, a); effects->registerAxisShortcut(Qt::ControlModifier | Qt::MetaModifier, PointerAxisDown, a); a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); - effects->registerGlobalShortcut(Qt::META + Qt::Key_Minus, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_Minus, a); effects->registerAxisShortcut(Qt::ControlModifier | Qt::MetaModifier, PointerAxisUp, a); a = KStandardAction::actualSize(this, SLOT(actualSize()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); - effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_0, a); a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomLeft")); @@ -99,17 +99,17 @@ ZoomEffect::ZoomEffect() a = new QAction(this); a->setObjectName(QStringLiteral("MoveMouseToFocus")); a->setText(i18n("Move Mouse to Focus")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_F5); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_F5); - effects->registerGlobalShortcut(Qt::META + Qt::Key_F5, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_F5)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_F5)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_F5, a); connect(a, &QAction::triggered, this, &ZoomEffect::moveMouseToFocus); a = new QAction(this); a->setObjectName(QStringLiteral("MoveMouseToCenter")); a->setText(i18n("Move Mouse to Center")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_F6); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_F6); - effects->registerGlobalShortcut(Qt::META + Qt::Key_F6, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_F6)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_F6)); + effects->registerGlobalShortcut(Qt::META | Qt::Key_F6, a); connect(a, &QAction::triggered, this, &ZoomEffect::moveMouseToCenter); timeline.setDuration(350); diff --git a/src/effects/zoom/zoom_config.cpp b/src/effects/zoom/zoom_config.cpp index 5e3217de44..be6d6b2225 100644 --- a/src/effects/zoom/zoom_config.cpp +++ b/src/effects/zoom/zoom_config.cpp @@ -60,60 +60,60 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) : QAction* a; a = actionCollection->addAction(KStandardAction::ZoomIn); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); a = actionCollection->addAction(KStandardAction::ZoomOut); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); a = actionCollection->addAction(KStandardAction::ActualSize); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); a = actionCollection->addAction(QStringLiteral("MoveZoomLeft")); a->setIcon(QIcon::fromTheme(QStringLiteral("go-previous"))); a->setText(i18n("Move Left")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Left); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Left); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Left)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Left)); a = actionCollection->addAction(QStringLiteral("MoveZoomRight")); a->setIcon(QIcon::fromTheme(QStringLiteral("go-next"))); a->setText(i18n("Move Right")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Right); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Right); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Right)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Right)); a = actionCollection->addAction(QStringLiteral("MoveZoomUp")); a->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); a->setText(i18n("Move Up")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Up); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Up); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Up)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Up)); a = actionCollection->addAction(QStringLiteral("MoveZoomDown")); a->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); a->setText(i18n("Move Down")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Down); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Down); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Down)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::CTRL | Qt::Key_Down)); a = actionCollection->addAction(QStringLiteral("MoveMouseToFocus")); a->setIcon(QIcon::fromTheme(QStringLiteral("view-restore"))); a->setText(i18n("Move Mouse to Focus")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_F5); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_F5); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_F5)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_F5)); a = actionCollection->addAction(QStringLiteral("MoveMouseToCenter")); a->setIcon(QIcon::fromTheme(QStringLiteral("view-restore"))); a->setText(i18n("Move Mouse to Center")); a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_F6); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_F6); + KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_F6)); + KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_F6)); m_ui->editor->addCollection(actionCollection); } diff --git a/src/kcmkwin/kwintabbox/kwintabboxconfigform.cpp b/src/kcmkwin/kwintabbox/kwintabboxconfigform.cpp index b1b7b98549..e1e86207ed 100644 --- a/src/kcmkwin/kwintabbox/kwintabboxconfigform.cpp +++ b/src/kcmkwin/kwintabbox/kwintabboxconfigform.cpp @@ -79,10 +79,10 @@ KWinTabBoxConfigForm::KWinTabBoxConfigForm(TabboxType type, QWidget *parent) m_actionCollection->setConfigGlobal(true); if (TabboxType::Main == m_type) { - addShortcut("Walk Through Windows", ui->scAll, Qt::ALT + Qt::Key_Tab); - addShortcut("Walk Through Windows (Reverse)", ui->scAllReverse, Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); - addShortcut("Walk Through Windows of Current Application", ui->scCurrent, Qt::ALT + Qt::Key_QuoteLeft); - addShortcut("Walk Through Windows of Current Application (Reverse)", ui->scCurrentReverse, Qt::ALT + Qt::Key_AsciiTilde); + addShortcut("Walk Through Windows", ui->scAll, Qt::ALT | Qt::Key_Tab); + addShortcut("Walk Through Windows (Reverse)", ui->scAllReverse, Qt::ALT | Qt::SHIFT | Qt::Key_Backtab); + addShortcut("Walk Through Windows of Current Application", ui->scCurrent, Qt::ALT | Qt::Key_QuoteLeft); + addShortcut("Walk Through Windows of Current Application (Reverse)", ui->scCurrentReverse, Qt::ALT | Qt::Key_AsciiTilde); } else if (TabboxType::Alternative == m_type) { addShortcut("Walk Through Windows Alternative", ui->scAll); addShortcut("Walk Through Windows Alternative (Reverse)", ui->scAllReverse); @@ -256,10 +256,10 @@ void KWinTabBoxConfigForm::resetShortcuts() KGlobalAccel::self()->setShortcut(a, QList() << sequence, KGlobalAccel::NoAutoloading); }; if (TabboxType::Main == m_type) { - resetShortcut(ui->scAll, Qt::ALT + Qt::Key_Tab); - resetShortcut(ui->scAllReverse, Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); - resetShortcut(ui->scCurrent, Qt::ALT + Qt::Key_QuoteLeft); - resetShortcut(ui->scCurrentReverse, Qt::ALT + Qt::Key_AsciiTilde); + resetShortcut(ui->scAll, Qt::ALT | Qt::Key_Tab); + resetShortcut(ui->scAllReverse, Qt::ALT | Qt::SHIFT | Qt::Key_Backtab); + resetShortcut(ui->scCurrent, Qt::ALT | Qt::Key_QuoteLeft); + resetShortcut(ui->scCurrentReverse, Qt::ALT | Qt::Key_AsciiTilde); } else if (TabboxType::Alternative == m_type) { resetShortcut(ui->scAll); resetShortcut(ui->scAllReverse); diff --git a/src/keyboard_layout.cpp b/src/keyboard_layout.cpp index 3bd129c3f0..bd22d46499 100644 --- a/src/keyboard_layout.cpp +++ b/src/keyboard_layout.cpp @@ -44,7 +44,7 @@ void KeyboardLayout::init() switchKeyboardAction->setObjectName(QStringLiteral("Switch to Next Keyboard Layout")); switchKeyboardAction->setProperty("componentName", QStringLiteral("KDE Keyboard Layout Switcher")); switchKeyboardAction->setProperty("componentDisplayName", i18n("Keyboard Layout Switcher")); - const QKeySequence sequence = QKeySequence(Qt::ALT+Qt::CTRL+Qt::Key_K); + const QKeySequence sequence = QKeySequence(Qt::ALT | Qt::CTRL | Qt::Key_K); KGlobalAccel::self()->setDefaultShortcut(switchKeyboardAction, QList({sequence})); KGlobalAccel::self()->setShortcut(switchKeyboardAction, QList({sequence})); kwinApp()->platform()->setupActionForGlobalAccel(switchKeyboardAction); diff --git a/src/tabbox/tabbox.cpp b/src/tabbox/tabbox.cpp index cbd8b12e0a..589b68dac1 100644 --- a/src/tabbox/tabbox.cpp +++ b/src/tabbox/tabbox.cpp @@ -538,10 +538,10 @@ static const char s_desktopListRev[] = I18N_NOOP("Walk Through Desktop List (Rev void TabBox::initShortcuts() { - key(s_windows, &TabBox::slotWalkThroughWindows, Qt::ALT + Qt::Key_Tab); - key(s_windowsRev, &TabBox::slotWalkBackThroughWindows, Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); - key(s_app, &TabBox::slotWalkThroughCurrentAppWindows, Qt::ALT + Qt::Key_QuoteLeft); - key(s_appRev, &TabBox::slotWalkBackThroughCurrentAppWindows, Qt::ALT + Qt::Key_AsciiTilde); + key(s_windows, &TabBox::slotWalkThroughWindows, Qt::ALT | Qt::Key_Tab); + key(s_windowsRev, &TabBox::slotWalkBackThroughWindows, Qt::ALT | Qt::SHIFT | Qt::Key_Backtab); + key(s_app, &TabBox::slotWalkThroughCurrentAppWindows, Qt::ALT | Qt::Key_QuoteLeft); + key(s_appRev, &TabBox::slotWalkBackThroughCurrentAppWindows, Qt::ALT | Qt::Key_AsciiTilde); key(s_windowsAlt, &TabBox::slotWalkThroughWindowsAlternative); key(s_windowsAltRev, &TabBox::slotWalkBackThroughWindowsAlternative); key(s_appAlt, &TabBox::slotWalkThroughCurrentAppWindowsAlternative); diff --git a/src/useractions.cpp b/src/useractions.cpp index 794cb5c990..7c294976d7 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -967,17 +967,17 @@ void Workspace::initShortcuts() initShortcut(QStringLiteral(name), i18n(name), key, target, &fnSlot); DEF(I18N_NOOP("Window Operations Menu"), - Qt::ALT + Qt::Key_F3, slotWindowOperations); + Qt::ALT | Qt::Key_F3, slotWindowOperations); DEF2("Window Close", I18N_NOOP("Close Window"), - Qt::ALT + Qt::Key_F4, slotWindowClose); + Qt::ALT | Qt::Key_F4, slotWindowClose); DEF2("Window Maximize", I18N_NOOP("Maximize Window"), - Qt::META + Qt::Key_PageUp, slotWindowMaximize); + Qt::META | Qt::Key_PageUp, slotWindowMaximize); DEF2("Window Maximize Vertical", I18N_NOOP("Maximize Window Vertically"), 0, slotWindowMaximizeVertical); DEF2("Window Maximize Horizontal", I18N_NOOP("Maximize Window Horizontally"), 0, slotWindowMaximizeHorizontal); DEF2("Window Minimize", I18N_NOOP("Minimize Window"), - Qt::META + Qt::Key_PageDown, slotWindowMinimize); + Qt::META | Qt::Key_PageDown, slotWindowMinimize); DEF2("Window Shade", I18N_NOOP("Shade Window"), 0, slotWindowShade); DEF2("Window Move", I18N_NOOP("Move Window"), @@ -999,7 +999,7 @@ void Workspace::initShortcuts() DEF2("Window Below Other Windows", I18N_NOOP("Keep Window Below Others"), 0, slotWindowBelow); DEF(I18N_NOOP("Activate Window Demanding Attention"), - Qt::CTRL + Qt::ALT + Qt::Key_A, slotActivateAttentionWindow); + Qt::CTRL | Qt::ALT | Qt::Key_A, slotActivateAttentionWindow); DEF(I18N_NOOP("Setup Window Shortcut"), 0, slotSetupWindowShortcut); DEF2("Window Move Center", I18N_NOOP("Move Window to the Center"), 0, @@ -1021,13 +1021,13 @@ void Workspace::initShortcuts() DEF2("Window Shrink Vertical", I18N_NOOP("Shrink Window Vertically"), 0, slotWindowShrinkVertical); DEF4("Window Quick Tile Left", I18N_NOOP("Quick Tile Window to the Left"), - Qt::META + Qt::Key_Left, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Left)); + Qt::META | Qt::Key_Left, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Left)); DEF4("Window Quick Tile Right", I18N_NOOP("Quick Tile Window to the Right"), - Qt::META + Qt::Key_Right, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Right)); + Qt::META | Qt::Key_Right, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Right)); DEF4("Window Quick Tile Top", I18N_NOOP("Quick Tile Window to the Top"), - Qt::META + Qt::Key_Up, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Top)); + Qt::META | Qt::Key_Up, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Top)); DEF4("Window Quick Tile Bottom", I18N_NOOP("Quick Tile Window to the Bottom"), - Qt::META + Qt::Key_Down, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Bottom)); + Qt::META | Qt::Key_Down, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Bottom)); DEF4("Window Quick Tile Top Left", I18N_NOOP("Quick Tile Window to the Top Left"), 0, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Top | QuickTileFlag::Left)); DEF4("Window Quick Tile Bottom Left", I18N_NOOP("Quick Tile Window to the Bottom Left"), @@ -1037,13 +1037,13 @@ void Workspace::initShortcuts() DEF4("Window Quick Tile Bottom Right", I18N_NOOP("Quick Tile Window to the Bottom Right"), 0, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Bottom | QuickTileFlag::Right)); DEF4("Switch Window Up", I18N_NOOP("Switch to Window Above"), - Qt::META + Qt::ALT + Qt::Key_Up, std::bind(static_cast(&Workspace::switchWindow), this, DirectionNorth)); + Qt::META | Qt::ALT | Qt::Key_Up, std::bind(static_cast(&Workspace::switchWindow), this, DirectionNorth)); DEF4("Switch Window Down", I18N_NOOP("Switch to Window Below"), - Qt::META + Qt::ALT + Qt::Key_Down, std::bind(static_cast(&Workspace::switchWindow), this, DirectionSouth)); + Qt::META | Qt::ALT | Qt::Key_Down, std::bind(static_cast(&Workspace::switchWindow), this, DirectionSouth)); DEF4("Switch Window Right", I18N_NOOP("Switch to Window to the Right"), - Qt::META + Qt::ALT + Qt::Key_Right, std::bind(static_cast(&Workspace::switchWindow), this, DirectionEast)); + Qt::META | Qt::ALT | Qt::Key_Right, std::bind(static_cast(&Workspace::switchWindow), this, DirectionEast)); DEF4("Switch Window Left", I18N_NOOP("Switch to Window to the Left"), - Qt::META + Qt::ALT + Qt::Key_Left, std::bind(static_cast(&Workspace::switchWindow), this, DirectionWest)); + Qt::META | Qt::ALT | Qt::Key_Left, std::bind(static_cast(&Workspace::switchWindow), this, DirectionWest)); DEF2("Increase Opacity", I18N_NOOP("Increase Opacity of Active Window by 5 %"), 0, slotIncreaseWindowOpacity); DEF2("Decrease Opacity", I18N_NOOP("Decrease Opacity of Active Window by 5 %"), @@ -1064,17 +1064,17 @@ void Workspace::initShortcuts() } DEF(I18N_NOOP("Window to Next Desktop"), 0, slotWindowToNextDesktop); DEF(I18N_NOOP("Window to Previous Desktop"), 0, slotWindowToPreviousDesktop); - DEF(I18N_NOOP("Window One Desktop to the Right"), Qt::META + Qt::CTRL + Qt::SHIFT + Qt::Key_Right, slotWindowToDesktopRight); - DEF(I18N_NOOP("Window One Desktop to the Left"), Qt::META + Qt::CTRL + Qt::SHIFT + Qt::Key_Left, slotWindowToDesktopLeft); - DEF(I18N_NOOP("Window One Desktop Up"), Qt::META + Qt::CTRL + Qt::SHIFT + Qt::Key_Up, slotWindowToDesktopUp); - DEF(I18N_NOOP("Window One Desktop Down"), Qt::META + Qt::CTRL + Qt::SHIFT + Qt::Key_Down, slotWindowToDesktopDown); + DEF(I18N_NOOP("Window One Desktop to the Right"), Qt::META | Qt::CTRL | Qt::SHIFT | Qt::Key_Right, slotWindowToDesktopRight); + DEF(I18N_NOOP("Window One Desktop to the Left"), Qt::META | Qt::CTRL | Qt::SHIFT | Qt::Key_Left, slotWindowToDesktopLeft); + DEF(I18N_NOOP("Window One Desktop Up"), Qt::META | Qt::CTRL | Qt::SHIFT | Qt::Key_Up, slotWindowToDesktopUp); + DEF(I18N_NOOP("Window One Desktop Down"), Qt::META | Qt::CTRL | Qt::SHIFT | Qt::Key_Down, slotWindowToDesktopDown); for (int i = 0; i < 8; ++i) { DEF3(I18N_NOOP("Window to Screen %1"), 0, slotWindowToScreen, i); } - DEF(I18N_NOOP("Window to Next Screen"), Qt::META + Qt::SHIFT + Qt::Key_Right, slotWindowToNextScreen); - DEF(I18N_NOOP("Window to Previous Screen"), Qt::META + Qt::SHIFT + Qt::Key_Left, slotWindowToPrevScreen); - DEF(I18N_NOOP("Show Desktop"), Qt::META + Qt::Key_D, slotToggleShowDesktop); + DEF(I18N_NOOP("Window to Next Screen"), Qt::META | Qt::SHIFT | Qt::Key_Right, slotWindowToNextScreen); + DEF(I18N_NOOP("Window to Previous Screen"), Qt::META | Qt::SHIFT | Qt::Key_Left, slotWindowToPrevScreen); + DEF(I18N_NOOP("Show Desktop"), Qt::META | Qt::Key_D, slotToggleShowDesktop); for (int i = 0; i < 8; ++i) { DEF3(I18N_NOOP("Switch to Screen %1"), 0, slotSwitchToScreen, i); @@ -1083,8 +1083,8 @@ void Workspace::initShortcuts() DEF(I18N_NOOP("Switch to Next Screen"), 0, slotSwitchToNextScreen); DEF(I18N_NOOP("Switch to Previous Screen"), 0, slotSwitchToPrevScreen); - DEF(I18N_NOOP("Kill Window"), Qt::CTRL + Qt::ALT + Qt::Key_Escape, slotKillWindow); - DEF6(I18N_NOOP("Suspend Compositing"), Qt::SHIFT + Qt::ALT + Qt::Key_F12, Compositor::self(), Compositor::toggleCompositing); + DEF(I18N_NOOP("Kill Window"), Qt::CTRL | Qt::ALT | Qt::Key_Escape, slotKillWindow); + DEF6(I18N_NOOP("Suspend Compositing"), Qt::SHIFT | Qt::ALT | Qt::Key_F12, Compositor::self(), Compositor::toggleCompositing); DEF6(I18N_NOOP("Invert Screen Colors"), 0, kwinApp()->platform(), Platform::invertScreen); #undef DEF diff --git a/src/virtualdesktops.cpp b/src/virtualdesktops.cpp index b1814758a7..e827ae6f61 100644 --- a/src/virtualdesktops.cpp +++ b/src/virtualdesktops.cpp @@ -804,13 +804,13 @@ void VirtualDesktopManager::initShortcuts() QAction *previousAction = addAction(QStringLiteral("Switch to Previous Desktop"), i18n("Switch to Previous Desktop"), &VirtualDesktopManager::slotPrevious); input()->registerTouchpadSwipeShortcut(SwipeDirection::Left, previousAction); QAction *slotRightAction = addAction(QStringLiteral("Switch One Desktop to the Right"), i18n("Switch One Desktop to the Right"), &VirtualDesktopManager::slotRight); - KGlobalAccel::setGlobalShortcut(slotRightAction, QKeySequence(Qt::CTRL + Qt::META + Qt::Key_Right)); + KGlobalAccel::setGlobalShortcut(slotRightAction, QKeySequence(Qt::CTRL | Qt::META | Qt::Key_Right)); QAction *slotLeftAction = addAction(QStringLiteral("Switch One Desktop to the Left"), i18n("Switch One Desktop to the Left"), &VirtualDesktopManager::slotLeft); - KGlobalAccel::setGlobalShortcut(slotLeftAction, QKeySequence(Qt::CTRL + Qt::META + Qt::Key_Left)); + KGlobalAccel::setGlobalShortcut(slotLeftAction, QKeySequence(Qt::CTRL | Qt::META | Qt::Key_Left)); QAction *slotUpAction = addAction(QStringLiteral("Switch One Desktop Up"), i18n("Switch One Desktop Up"), &VirtualDesktopManager::slotUp); - KGlobalAccel::setGlobalShortcut(slotUpAction, QKeySequence(Qt::CTRL + Qt::META + Qt::Key_Up)); + KGlobalAccel::setGlobalShortcut(slotUpAction, QKeySequence(Qt::CTRL | Qt::META | Qt::Key_Up)); QAction *slotDownAction = addAction(QStringLiteral("Switch One Desktop Down"), i18n("Switch One Desktop Down"), &VirtualDesktopManager::slotDown); - KGlobalAccel::setGlobalShortcut(slotDownAction, QKeySequence(Qt::CTRL + Qt::META + Qt::Key_Down)); + KGlobalAccel::setGlobalShortcut(slotDownAction, QKeySequence(Qt::CTRL | Qt::META | Qt::Key_Down)); // axis events input()->registerAxisShortcut(Qt::ControlModifier | Qt::AltModifier, PointerAxisDown, @@ -823,10 +823,10 @@ void VirtualDesktopManager::initSwitchToShortcuts() { const QString toDesktop = QStringLiteral("Switch to Desktop %1"); const KLocalizedString toDesktopLabel = ki18n("Switch to Desktop %1"); - addAction(toDesktop, toDesktopLabel, 1, QKeySequence(Qt::CTRL + Qt::Key_F1), &VirtualDesktopManager::slotSwitchTo); - addAction(toDesktop, toDesktopLabel, 2, QKeySequence(Qt::CTRL + Qt::Key_F2), &VirtualDesktopManager::slotSwitchTo); - addAction(toDesktop, toDesktopLabel, 3, QKeySequence(Qt::CTRL + Qt::Key_F3), &VirtualDesktopManager::slotSwitchTo); - addAction(toDesktop, toDesktopLabel, 4, QKeySequence(Qt::CTRL + Qt::Key_F4), &VirtualDesktopManager::slotSwitchTo); + addAction(toDesktop, toDesktopLabel, 1, QKeySequence(Qt::CTRL | Qt::Key_F1), &VirtualDesktopManager::slotSwitchTo); + addAction(toDesktop, toDesktopLabel, 2, QKeySequence(Qt::CTRL | Qt::Key_F2), &VirtualDesktopManager::slotSwitchTo); + addAction(toDesktop, toDesktopLabel, 3, QKeySequence(Qt::CTRL | Qt::Key_F3), &VirtualDesktopManager::slotSwitchTo); + addAction(toDesktop, toDesktopLabel, 4, QKeySequence(Qt::CTRL | Qt::Key_F4), &VirtualDesktopManager::slotSwitchTo); for (uint i = 5; i <= maximum(); ++i) { addAction(toDesktop, toDesktopLabel, i, QKeySequence(), &VirtualDesktopManager::slotSwitchTo);