aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-11-18 15:17:14 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-11-30 13:42:47 +0000
commit86a8bcede091d0afe15c26b6fb2efcbf5989c13b (patch)
treeb1f0d2ffbf6278d51bf45e62640cad7dedec6f35 /src
parentfe2e7b73402583e996c1fa05d78abd04a4d95b76 (diff)
qquickwindow: handle QEvent::ShortcutOverride
After qtbase:c7e5e1d, QEvent::ShortcutOverride is no longer sent directly to the focus object, but to the window. But since QQuickWindow didn't catch it, it ended up nowhere. This patch will implement the same strategy as QWidgetWindow, and let QQuickWindow forward the ShortcutOverride event the same way as key events. Note that even if the event was never being delivered, the corresponding key events would still end up in the focus object and trigger shortcuts. But if a window global shortcut existed with the same key sequence, it would grab the shortcut instead of the override, which was wrong. Change-Id: I4ad7b3879adac14d88a3fbce5851409d0963d163 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 6542bde4f1..845fa816c9 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1406,6 +1406,10 @@ bool QQuickWindow::event(QEvent *e)
d->deliverNativeGestureEvent(d->contentItem, static_cast<QNativeGestureEvent*>(e));
break;
#endif
+ case QEvent::ShortcutOverride:
+ if (d->activeFocusItem)
+ sendEvent(d->activeFocusItem, static_cast<QKeyEvent *>(e));
+ return true;
default:
break;
}
@@ -2584,6 +2588,9 @@ bool QQuickWindow::sendEvent(QQuickItem *item, QEvent *e)
QCoreApplication::sendEvent(item, e);
}
break;
+ case QEvent::ShortcutOverride:
+ QCoreApplication::sendEvent(item, e);
+ break;
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick: