diff options
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/testlib/TestCase.qml | 6 | ||||
-rw-r--r-- | src/imports/testlib/testcase.qdoc | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index ddd7f7030f..79c68a75a7 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -357,6 +357,12 @@ Item { qtest_results.wait(ms) } + function waitForRendering(item, timeout) { + if (timeout === undefined) + timeout = 5000 + return qtest_results.waitForRendering(item, timeout) + } + function sleep(ms) { qtest_results.sleep(ms) } diff --git a/src/imports/testlib/testcase.qdoc b/src/imports/testlib/testcase.qdoc index 8a0f770544..77cfae140e 100644 --- a/src/imports/testlib/testcase.qdoc +++ b/src/imports/testlib/testcase.qdoc @@ -474,7 +474,17 @@ Waits for \a ms milliseconds while processing Qt events. - \sa sleep() + \sa sleep(), waitForRendering() +*/ + +/*! + \qmlmethod TestCase::waitForRendering(item, timeout = 5000) + + Waits for \a timeout milliseconds or until the \a item is rendered by the renderer. + Returns true if \c item is rendered in \a timeout milliseconds, otherwise returns false. + The default \a timeout value is 5000. + + \sa sleep(), wait() */ /*! @@ -482,7 +492,7 @@ Sleeps for \a ms milliseconds without processing Qt events. - \sa wait() + \sa wait(), waitForRendering() */ /*! |