QCocoaKeyMapper: do not sum integral+QFlags

It will become illegal; keep the semantics but force the
right casts.

Change-Id: I4002c5bca6eb90e798e35ca263e7bbb4ff5ad4b1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2020-09-03 13:44:07 +02:00
parent f6802a5aac
commit d5db4ab46d

View File

@ -514,7 +514,7 @@ QList<int> QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const
// The base key, with the complete set of modifiers,
// is always valid, and the first priority.
ret << int(unmodifiedKey + eventModifiers);
ret << int(unmodifiedKey) + int(eventModifiers);
// FIXME: We only compute the first 8 combinations. Why?
for (int i = 1; i < 8; ++i) {
@ -526,7 +526,7 @@ QList<int> QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const
// perfectly, the current candidate modifiers.
auto candidateModifiers = modifierCombinations[i];
if ((eventModifiers & candidateModifiers) == candidateModifiers)
ret << int(keyAfterApplyingModifiers + (eventModifiers & ~candidateModifiers));
ret << int(keyAfterApplyingModifiers) + int(eventModifiers & ~candidateModifiers);
}
return ret;