summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 27a152b706..af3d134a5a 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2861,7 +2861,14 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QKeyEvent* key = static_cast<QKeyEvent*>(e);
#ifndef QT_NO_SHORTCUT
// Try looking for a Shortcut before sending key events
- if (qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key))
+ QObject *shortcutReceiver = receiver;
+ if (!isWidget && isWindow) {
+ QWindow *w = qobject_cast<QWindow *>(receiver);
+ QObject *focus = w ? w->focusObject() : 0;
+ if (focus)
+ shortcutReceiver = focus;
+ }
+ if (qApp->d_func()->shortcutMap.tryShortcutEvent(shortcutReceiver, key))
return true;
#endif
qt_in_tab_key_event = (key->key() == Qt::Key_Backtab