aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-02-07 13:35:00 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-02-16 09:25:22 +0000
commit5e4b4b02f22f72c4143085e26dcf8d87031b423d (patch)
tree166a6372359c6c62683e758006d67426ee8b23c2
parent486376f82547172ff20008fe17c9539a920f61ac (diff)
QmlTest: Document timer drift between TestCase and Timer
Pick-to: 6.2 Fixes: QTBUG-120105 Change-Id: I5d07068a6ed639b461cd3c9e314869a72d13f5b0 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> (cherry picked from commit 198a90f56255bf9e5cf4416b973682cdc708d77b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b156a1f1f93b4d374a455f10bf13c642746325a7) (cherry picked from commit 11dcf2d228838f146626185204caf2de2506a4a1)
-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 09094a0375..6880b53cc3 100644
--- a/src/qmltest/TestCase.qml
+++ b/src/qmltest/TestCase.qml
@@ -1313,7 +1313,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)