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>
This commit is contained in:
Gunnar Sletta 2011-09-28 20:09:34 +02:00 committed by Qt by Nokia
parent 73945fb9f2
commit 28a31f41d1

View 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,