aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qmltest/TestCase.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qmltest/TestCase.qml b/src/qmltest/TestCase.qml
index 638372a42a..9b47254bdb 100644
--- a/src/qmltest/TestCase.qml
+++ b/src/qmltest/TestCase.qml
@@ -166,6 +166,15 @@ import "testlogger.js" as TestLogger
and mouseMove() methods can be used to simulate mouse events in a
similar fashion.
+ If your test creates other windows, it's possible that those windows
+ become active, stealing the focus from the TestCase's window. To ensure
+ that the TestCase's window is active, use the following code:
+
+ \code
+ testCase.Window.window.requestActivate()
+ tryCompare(testCase.Window.window, "active", true)
+ \endcode
+
\b{Note:} keyboard and mouse events can only be delivered once the
main window has been shown. Attempts to deliver events before then
will fail. Use the \l when and windowShown properties to track