diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/testlib/qtestkeyboard.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h index 82dd6fa098..d73658d8fc 100644 --- a/src/testlib/qtestkeyboard.h +++ b/src/testlib/qtestkeyboard.h @@ -61,7 +61,7 @@ Q_GUI_EXPORT bool qt_sendShortcutOverrideEvent(QObject *o, ulong timestamp, int namespace QTest { - enum KeyAction { Press, Release, Click }; + enum KeyAction { Press, Release, Click, Shortcut }; static void simulateEvent(QWindow *window, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1) @@ -95,6 +95,12 @@ namespace QTest bool repeat = false; + if (action == Shortcut) { + int timestamp = 0; + qt_sendShortcutOverrideEvent(window, timestamp, code, modifier, text, repeat); + return; + } + if (action == Press) { if (modifier & Qt::ShiftModifier) simulateEvent(window, true, Qt::Key_Shift, Qt::KeyboardModifiers(), QString(), false, delay); |