From 5eef3cde22a217a8b82bd00815850e797f4f3eaf Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sun, 3 Apr 2022 11:57:27 +0200 Subject: [PATCH] Adapt to QKeySequence changes in Qt6 --- src/useractions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/useractions.cpp b/src/useractions.cpp index 3b6c9e7e0c..2a54d9fadc 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -833,12 +833,20 @@ void ShortcutDialog::accept() { QKeySequence seq = shortcut(); if (!seq.isEmpty()) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (seq[0] == Qt::Key_Escape) { +#else + if (seq[0] == QKeyCombination(Qt::Key_Escape)) { +#endif reject(); return; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (seq[0] == Qt::Key_Space || (seq[0] & Qt::KeyboardModifierMask) == 0) { +#else + if (seq[0] == QKeyCombination(Qt::Key_Space) || seq[0].keyboardModifiers() == Qt::NoModifier) { +#endif // clear m_ui.keySequenceEdit->clear(); QDialog::accept();