From e7b97ee375ffc216b25480094fb87e484ec56d1d Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 Jul 2024 09:30:18 +0200 Subject: [PATCH] CorePlugin: Fix warning about deprecated operator int() Operate now on QKeyCombination instead. Return false if there are modifiers other than Shift or Keypad. Otherwise, return the result of comparing key() with the Escape key. Change-Id: Ica6409a7b7b5ed28e79915691c40a898008735f7 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/dialogs/shortcutsettings.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index 4c7de88fd9b..461c14669b9 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -121,11 +121,10 @@ static bool isTextKeySequence(const QKeySequence &sequence) { if (sequence.isEmpty()) return false; - int key = sequence[0]; - key &= ~(Qt::ShiftModifier | Qt::KeypadModifier); - if (key < Qt::Key_Escape) - return true; - return false; + const QKeyCombination keyCombination = sequence[0]; + if (keyCombination.keyboardModifiers() & ~(Qt::ShiftModifier | Qt::KeypadModifier)) + return false; + return keyCombination.key() < Qt::Key_Escape; } static FilePath schemesPath()