aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-02-07 13:35:00 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-02-15 22:34:49 +0100
commit198a90f56255bf9e5cf4416b973682cdc708d77b (patch)
treee140c0a9436373c937d28270371232027ea68ca2 /src/qmltest
parent413710898a2d7dfd7f07495236db0077e92bd368 (diff)
QmlTest: Document timer drift between TestCase and Timer
Pick-to: 6.7 6.6 6.5 6.2 Fixes: QTBUG-120105 Change-Id: I5d07068a6ed639b461cd3c9e314869a72d13f5b0 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/TestCase.qml11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qmltest/TestCase.qml b/src/qmltest/TestCase.qml
index 9b47254bdb..3046d0677c 100644
--- a/src/qmltest/TestCase.qml
+++ b/src/qmltest/TestCase.qml
@@ -1314,7 +1314,16 @@ Item {
Waits for \a ms milliseconds while processing Qt events.
- \sa sleep(), waitForRendering()
+ \note This methods uses a precise timer to do the actual waiting. The
+ event you are waiting for may not. In particular, any animations as
+ well as the \l{Timer} QML type can use either precise or coarse
+ timers, depending on various factors. For a coarse timer you have
+ to expect a drift of around 5% in relation to the precise timer used
+ by TestCase::wait(). Qt cannot give hard guarantees on the drift,
+ though, because the operating system usually doesn't offer hard
+ guarantees on timers.
+
+ \sa sleep(), waitForRendering(), Qt::TimerType
*/
function wait(ms) {
qtest_results.wait(ms)