summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qshortcutmap.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-01-21 08:17:21 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-01-21 08:17:21 +0100
commit158a3a4159bdc5a49caecd63e021dacbc06cf23c (patch)
treec3ed9aee6cabd46e5e8615b3815b92d32857c4da /src/gui/kernel/qshortcutmap.cpp
parent26ece94a68fb5ae680c5639716b06c4e1ae979a8 (diff)
parent7b2fb038ae4b8b9231ae989ad309b6eca107a858 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
Diffstat (limited to 'src/gui/kernel/qshortcutmap.cpp')
-rw-r--r--src/gui/kernel/qshortcutmap.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index 971fa1194f..63c724cd6c 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -342,12 +342,16 @@ bool QShortcutMap::tryShortcut(QKeyEvent *e)
// For a partial match we don't know yet if we will handle the shortcut
// but we need to say we did, so that we get the follow-up key-presses.
return true;
- case QKeySequence::ExactMatch:
+ case QKeySequence::ExactMatch: {
+ // Save number of identical matches before dispatching
+ // to keep QShortcutMap and tryShortcut reentrant.
+ const int identicalMatches = d->identicals.count();
resetState();
dispatchEvent(e);
// If there are no identicals we've only found disabled shortcuts, and
// shouldn't say that we handled the event.
- return d->identicals.count() > 0;
+ return identicalMatches > 0;
+ }
default:
Q_UNREACHABLE();
}