Adapt to QKeySequence changes in Qt6

This commit is contained in:
Volker Krause 2022-04-03 11:57:27 +02:00
parent 52035f43b9
commit 5eef3cde22

View file

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