diff options
| author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-20 19:12:23 +0200 |
|---|---|---|
| committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-20 19:12:25 +0200 |
| commit | 3361fcbc28be96262d22fd2b024c85fbcbc61462 (patch) | |
| tree | 48976f337b3885971dc1976b9a27cec5e7dfa2ec /src/gui/kernel/qwindowsysteminterface.cpp | |
| parent | dc612acdc6577594c8f61345cea2de549d7aae34 (diff) | |
| parent | 5e342f6f041208d142d97202f61179d7163eb773 (diff) | |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
| -rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index d03a3f7be81..bd95a8614f7 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -201,9 +201,13 @@ bool QWindowSystemInterface::tryHandleShortcutEvent(QWindow *w, ulong timestamp, #ifndef QT_NO_SHORTCUT QGuiApplicationPrivate::modifier_buttons = mods; + QObject *focus = w->focusObject(); + if (!focus) + focus = w; + QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count); qevent.setTimestamp(timestamp); - return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent); + return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, &qevent); #else Q_UNUSED(w) Q_UNUSED(timestamp) @@ -231,9 +235,13 @@ bool QWindowSystemInterface::tryHandleExtendedShortcutEvent(QWindow *w, ulong ti #ifndef QT_NO_SHORTCUT QGuiApplicationPrivate::modifier_buttons = mods; + QObject *focus = w->focusObject(); + if (!focus) + focus = w; + QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count); qevent.setTimestamp(timestamp); - return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent); + return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, &qevent); #else Q_UNUSED(w) Q_UNUSED(timestamp) |
