Filter key press events through shortcut map.
authorFrederik Gladhorn <frederik.gladhorn@digia.com>
Mon, 14 Jan 2013 09:22:12 +0000 (10:22 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 14 Jan 2013 12:55:35 +0000 (13:55 +0100)
This allows QQuickItems to use shortcuts.

Change-Id: I068109a954d92e4e7bd5e63d2b3523b66855c60a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
src/quick/items/qquickwindow.cpp

index 2cde3cc..eb3a74f 100644 (file)
@@ -1166,6 +1166,12 @@ void QQuickWindow::keyPressEvent(QKeyEvent *e)
 {
     Q_D(QQuickWindow);
 
+#ifndef QT_NO_SHORTCUT
+    // Try looking for a Shortcut before sending key events
+    if (QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(this, e))
+        return;
+#endif
+
     if (d->activeFocusItem)
         sendEvent(d->activeFocusItem, e);
 }