summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-09-04 17:56:24 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-09-15 07:41:17 +0000
commit0e342fce4c665d72a50147c4f4b30ea08cc6c87b (patch)
treebe3dcb1cc94481ac276943855fec982ba202721f /src/testlib
parent0a1206a8b2449855bd646549260b2f3087d9ef6c (diff)
Replace direct QPA access in tst_qguiappliction with testlib wrapper
Change-Id: I698aa9d7633992d257296759f5e04307ff0d8331 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestkeyboard.h8
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);