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 <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2024-07-22 09:30:18 +02:00
parent 8ea9028491
commit e7b97ee375

View File

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