Use | rather than + for combining QFlags

The plus operator is no longer available for flags in Qt6.
This commit is contained in:
Volker Krause 2022-03-09 17:35:12 +01:00
parent 03c80db56d
commit 51250cfb4a
30 changed files with 188 additions and 188 deletions

View file

@ -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<QKeySequence>{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<QKeySequence>{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)

View file

@ -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<QKeySequence>{Qt::CTRL+Qt::ALT+Qt::Key_1}, KGlobalAccel::NoAutoloading);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>{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<QKeySequence>{Qt::CTRL+Qt::ALT+Qt::Key_2}, KGlobalAccel::NoAutoloading);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>{Qt::CTRL|Qt::ALT|Qt::Key_2}, KGlobalAccel::NoAutoloading);
delete a;
// now we should have three layouts

View file

@ -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<QKeySequence>{Qt::CTRL + Qt::META + Qt::ALT + Qt::Key_Space});
KGlobalAccel::self()->setShortcut(action.data(), QList<QKeySequence>{Qt::CTRL + Qt::META + Qt::ALT + Qt::Key_Space},
KGlobalAccel::self()->setDefaultShortcut(action.data(), QList<QKeySequence>{Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_Space});
KGlobalAccel::self()->setShortcut(action.data(), QList<QKeySequence>{Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_Space},
KGlobalAccel::NoAutoloading);
// try to trigger the shortcut

View file

@ -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<QKeySequence>{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<QKeySequence>{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;

View file

@ -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++);

View file

@ -115,10 +115,10 @@ DesktopGridEffect::DesktopGridEffect()
s->setObjectName(QStringLiteral("ShowDesktopGrid"));
s->setText(i18n("Show Desktop Grid"));
KGlobalAccel::self()->setDefaultShortcut(s, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F8);
KGlobalAccel::self()->setShortcut(s, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F8);
KGlobalAccel::self()->setDefaultShortcut(s, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F8));
KGlobalAccel::self()->setShortcut(s, QList<QKeySequence>() << (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;
}

View file

@ -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<QKeySequence>() << Qt::CTRL + Qt::Key_F8);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F8);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F8));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F8));
m_ui->shortcutEditor->addCollection(m_actionCollection);

View file

@ -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<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I);
effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_I, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::Key_I));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U);
KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U);
effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_U, b);
KGlobalAccel::self()->setDefaultShortcut(b, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::Key_U));
KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << (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);

View file

@ -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<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::Key_I));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U);
KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U);
KGlobalAccel::self()->setDefaultShortcut(b, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::Key_U));
KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::Key_U));
mShortcutEditor = new KShortcutsEditor(actionCollection, this,
KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed);

View file

@ -53,19 +53,19 @@ LookingGlassEffect::LookingGlassEffect()
initConfig<LookingGlassConfig>();
QAction* a;
a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
effects->registerGlobalShortcut(Qt::META + Qt::Key_Minus, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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);

View file

@ -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<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
a = m_actionCollection->addAction(KStandardAction::ZoomOut);
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
a = m_actionCollection->addAction(KStandardAction::ActualSize);
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
m_ui->editor->addCollection(m_actionCollection);
}

View file

@ -36,19 +36,19 @@ MagnifierEffect::MagnifierEffect()
initConfig<MagnifierConfig>();
QAction* a;
a = KStandardAction::zoomIn(this, &MagnifierEffect::zoomIn, this);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
effects->registerGlobalShortcut(Qt::META + Qt::Key_Minus, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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);

View file

@ -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<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
a = m_actionCollection->addAction(KStandardAction::ZoomOut);
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
a = m_actionCollection->addAction(KStandardAction::ActualSize);
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
m_ui->editor->addCollection(m_actionCollection);
}

View file

@ -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<QKeySequence>() << Qt::META + Qt::Key_Asterisk);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Asterisk);
effects->registerGlobalShortcut(Qt::META + Qt::Key_Asterisk, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Asterisk));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Asterisk));
effects->registerGlobalShortcut(Qt::META | Qt::Key_Asterisk, a);
connect(a, &QAction::triggered, this, &MouseClickEffect::toggleEnabled);
reconfigure(ReconfigureAll);

View file

@ -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<QKeySequence>() << Qt::META + Qt::Key_Asterisk);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Asterisk);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Asterisk));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Asterisk));
m_ui->editor->addCollection(m_actionCollection);

View file

@ -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<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F11);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F11);
effects->registerGlobalShortcut(Qt::SHIFT + Qt::META + Qt::Key_F11, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::SHIFT | Qt::META | Qt::Key_F11));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F12);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F12);
effects->registerGlobalShortcut(Qt::SHIFT + Qt::META + Qt::Key_F12, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::SHIFT | Qt::META | Qt::Key_F12));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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);

View file

@ -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<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F11);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F11);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::SHIFT | Qt::META | Qt::Key_F11));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F12);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F12);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::SHIFT | Qt::META | Qt::Key_F12));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::SHIFT | Qt::META | Qt::Key_F12));
m_ui->editor->addCollection(m_actionCollection);

View file

@ -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);

View file

@ -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();
}

View file

@ -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<QKeySequence>() << Qt::CTRL + Qt::Key_F9);
KGlobalAccel::self()->setShortcut(exposeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9);
KGlobalAccel::self()->setDefaultShortcut(exposeAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F9));
KGlobalAccel::self()->setShortcut(exposeAction, QList<QKeySequence>() << (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<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC);
KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << (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<QKeySequence>() << Qt::CTRL + Qt::Key_F7);
KGlobalAccel::self()->setShortcut(exposeClassAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7);
effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F7, exposeClassAction);
KGlobalAccel::self()->setDefaultShortcut(exposeClassAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F7));
KGlobalAccel::self()->setShortcut(exposeClassAction, QList<QKeySequence>() << (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;
}

View file

@ -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<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::CTRL + Qt::Key_F9);
KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9);
KGlobalAccel::self()->setDefaultShortcut(b, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F9));
KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << (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<QKeySequence>() << Qt::CTRL + Qt::Key_F7);
KGlobalAccel::self()->setShortcut(c, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7);
KGlobalAccel::self()->setDefaultShortcut(c, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F7));
KGlobalAccel::self()->setShortcut(c, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F7));
m_ui->shortcutEditor->addCollection(m_actionCollection);

View file

@ -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<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_T);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_T);
effects->registerGlobalShortcut(Qt::META + Qt::CTRL + Qt::Key_T, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::CTRL | Qt::Key_T));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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);

View file

@ -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<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_T);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_T);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::CTRL | Qt::Key_T));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::CTRL | Qt::Key_T));
m_ui->editor->addCollection(m_actionCollection);
}

View file

@ -47,21 +47,21 @@ ZoomEffect::ZoomEffect()
initConfig<ZoomConfig>();
QAction* a = nullptr;
a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
effects->registerGlobalShortcut(Qt::META + Qt::Key_Minus, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_F5);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F5);
effects->registerGlobalShortcut(Qt::META + Qt::Key_F5, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_F5));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_F6);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F6);
effects->registerGlobalShortcut(Qt::META + Qt::Key_F6, a);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_F6));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_F6));
effects->registerGlobalShortcut(Qt::META | Qt::Key_F6, a);
connect(a, &QAction::triggered, this, &ZoomEffect::moveMouseToCenter);
timeline.setDuration(350);

View file

@ -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<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
a = actionCollection->addAction(KStandardAction::ZoomOut);
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Minus));
a = actionCollection->addAction(KStandardAction::ActualSize);
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_0));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Left);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Left);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::CTRL | Qt::Key_Left));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Right);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Right);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::CTRL | Qt::Key_Right));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Up);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Up);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::CTRL | Qt::Key_Up));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Down);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_Down);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::CTRL | Qt::Key_Down));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_F5);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F5);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_F5));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (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<QKeySequence>() << Qt::META + Qt::Key_F6);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F6);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_F6));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_F6));
m_ui->editor->addCollection(actionCollection);
}

View file

@ -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<QKeySequence>() << 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);

View file

@ -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<QKeySequence>({sequence}));
KGlobalAccel::self()->setShortcut(switchKeyboardAction, QList<QKeySequence>({sequence}));
kwinApp()->platform()->setupActionForGlobalAccel(switchKeyboardAction);

View file

@ -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);

View file

@ -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<void (Workspace::*)(Direction)>(&Workspace::switchWindow), this, DirectionNorth));
Qt::META | Qt::ALT | Qt::Key_Up, std::bind(static_cast<void (Workspace::*)(Direction)>(&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<void (Workspace::*)(Direction)>(&Workspace::switchWindow), this, DirectionSouth));
Qt::META | Qt::ALT | Qt::Key_Down, std::bind(static_cast<void (Workspace::*)(Direction)>(&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<void (Workspace::*)(Direction)>(&Workspace::switchWindow), this, DirectionEast));
Qt::META | Qt::ALT | Qt::Key_Right, std::bind(static_cast<void (Workspace::*)(Direction)>(&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<void (Workspace::*)(Direction)>(&Workspace::switchWindow), this, DirectionWest));
Qt::META | Qt::ALT | Qt::Key_Left, std::bind(static_cast<void (Workspace::*)(Direction)>(&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

View file

@ -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);