summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.qdoc
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-02-07 14:09:04 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-02-21 14:32:28 +0000
commit3b38392844dd9e145a4783445fd3c96e84bb94d1 (patch)
tree3965cab0ed4eaeafa49d34111ffafd70c0649ae6 /src/testlib/qtestcase.qdoc
parent22a88dce03f12c70aa9987570cc408829cb2574e (diff)
testlib: Add qWaitFor to wait for predicate
Reduces duplication of logic and allows other primitives to be built on top. Change-Id: Ia100014cfb0c09ac2f47c3a156d0c76f0fddafa8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.qdoc')
-rw-r--r--src/testlib/qtestcase.qdoc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc
index 8f3d140add..f7d816b8f9 100644
--- a/src/testlib/qtestcase.qdoc
+++ b/src/testlib/qtestcase.qdoc
@@ -1062,6 +1062,21 @@
\sa QTest::qSleep(), QSignalSpy::wait()
*/
+/*! \fn void QTest::qWaitFor(Predicate predicate, int timeout)
+
+ Waits for \a timeout milliseconds or until the \a predicate returns true.
+
+ Returns \c true if the \a preciate returned true within \a timeout milliseconds, otherwise returns \c false.
+
+ Example:
+ \snippet code/src_qtestlib_qtestcase.cpp 30
+
+ The code above will wait for the object to become ready, for a
+ maximum of three seconds.
+
+ \since 5.9
+*/
+
/*! \fn bool QTest::qWaitForWindowExposed(QWindow *window, int timeout)
\since 5.0