add a latency after simulating keyevets since they are queued up
authorGunnar Sletta <gunnar.sletta@nokia.com>
Wed, 28 Sep 2011 18:09:34 +0000 (20:09 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 3 Oct 2011 05:57:41 +0000 (07:57 +0200)
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>
src/testlib/qtestkeyboard.h

index 51e0908..5809a00 100644 (file)
@@ -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,