From 4067bbc24cf7a6d3058387225d9e67ad093991cd Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 14 Jul 2015 18:31:03 +0200 Subject: Fix shortcut handling with modifiers Since d7ca800a87a2291c94c6580f0cfe068bb2280caf the shortcut events were only sent once. The one sent by QGuiApplication did not create a QKeyEvent with the full native modifier state - basically the extended key event expected everywhere. That means that shortcuts on some keyboard layouts - like ctrl-shift-7 on the German keyboard (resulting in ctrl+/) - would not work when the shortcut override was tested from QGuiApplication, but then the same shortcut was sent from QApplication with the full information, so it worked the second time. Shortcuts of this type in Qt Quick were broken before. Task-number: QTBUG-47062 Change-Id: I8390b9a96d0d998a2a538ac65503702e0d299cc7 Reviewed-by: Andy Shaw Reviewed-by: Gatis Paeglis --- src/gui/kernel/qwindowsysteminterface.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/kernel/qwindowsysteminterface.h') diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index c004fc6ef2..448c5d0893 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -78,6 +78,8 @@ public: Qt::KeyboardModifiers mods = Qt::NoModifier, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); + static bool tryHandleShortcutOverrideEvent(QWindow *w, QKeyEvent *ev); + static bool tryHandleShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1); static bool tryHandleShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods, -- cgit v1.2.3