summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestkeyboard.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-09-28 20:09:34 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-03 07:57:41 +0200
commit28a31f41d1e6266582d21bd169cfba270b665569 (patch)
tree1d1c08128fb5f9eb0e029fad8847836f5e6ed6c3 /src/testlib/qtestkeyboard.h
parent73945fb9f223a732a7e739a1c9786bbe110fdf3e (diff)
add a latency after simulating keyevets since they are queued up
Change-Id: Iaaaf01ab464cb2d310ed738de85ffdecd6cd854f Reviewed-on: http://codereview.qt-project.org/5770 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Diffstat (limited to 'src/testlib/qtestkeyboard.h')
-rw-r--r--src/testlib/qtestkeyboard.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h
index 51e0908e6f..5809a00144 100644
--- a/src/testlib/qtestkeyboard.h
+++ b/src/testlib/qtestkeyboard.h
@@ -74,6 +74,11 @@ namespace QTest
QEvent::Type type;
type = press ? QEvent::KeyPress : QEvent::KeyRelease;
QWindowSystemInterface::handleKeyEvent(window, type, code, modifier, text, repeat, delay);
+#ifdef QT_MAC_USE_COCOA
+ QTest::qWait(20);
+#else
+ qApp->processEvents();
+#endif
}
static void sendKeyEvent(KeyAction action, QWindow *window, Qt::Key code,