summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-09-03 13:44:07 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-09-03 14:29:47 +0200
commitd5db4ab46d662547410d4f98621aff5131d5fc15 (patch)
tree253a9a7c1d5cf50bca77618c4fe640c5459c4260 /src/plugins
parentf6802a5aac49f6161d60e9b3e761093e292f2fc4 (diff)
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>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoakeymapper.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
index d1654e84bb..5197ac1824 100644
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
@@ -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;