Skip to content

Commit 5e4b4b0

Browse files
Ulf HermannQt Cherry-pick Bot
authored andcommitted
QmlTest: Document timer drift between TestCase and Timer
Pick-to: 6.2 Fixes: QTBUG-120105 Change-Id: I5d07068a6ed639b461cd3c9e314869a72d13f5b0 Reviewed-by: Andreas Aardal Hanssen <[email protected]> (cherry picked from commit 198a90f) Reviewed-by: Qt Cherry-pick Bot <[email protected]> (cherry picked from commit b156a1f) (cherry picked from commit 11dcf2d)
1 parent 486376f commit 5e4b4b0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/qmltest/TestCase.qml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,16 @@ Item {
13131313
13141314
Waits for \a ms milliseconds while processing Qt events.
13151315
1316-
\sa sleep(), waitForRendering()
1316+
\note This methods uses a precise timer to do the actual waiting. The
1317+
event you are waiting for may not. In particular, any animations as
1318+
well as the \l{Timer} QML type can use either precise or coarse
1319+
timers, depending on various factors. For a coarse timer you have
1320+
to expect a drift of around 5% in relation to the precise timer used
1321+
by TestCase::wait(). Qt cannot give hard guarantees on the drift,
1322+
though, because the operating system usually doesn't offer hard
1323+
guarantees on timers.
1324+
1325+
\sa sleep(), waitForRendering(), Qt::TimerType
13171326
*/
13181327
function wait(ms) {
13191328
qtest_results.wait(ms)

0 commit comments

Comments
 (0)