From e2ad422e88373ac8e03f716d7f30800e2381aa16 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 12 Dec 2012 01:01:17 +0100 Subject: [PATCH] Doc: recommend using QVERIFY with QSignalSpy::wait, so people don't forget. Change-Id: I63a04b64368a4b8aa6cfea88780b8dd6ba38b8bf Reviewed-by: Paul Olav Tvete --- src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp | 4 ++++ src/testlib/qsignalspy.qdoc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp index a0fd16f577..6741ae7942 100644 --- a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp +++ b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp @@ -79,3 +79,7 @@ QModelIndex result = qvariant_cast(spy.at(0).at(0)); //! [4] QSignalSpy spy(myPushButton, SIGNAL(clicked(bool))); //! [4] + +//! [5] +QVERIFY(spy.wait(1000)); +//! [5] diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc index 30ab7c8b55..d36716bf2e 100644 --- a/src/testlib/qsignalspy.qdoc +++ b/src/testlib/qsignalspy.qdoc @@ -94,4 +94,7 @@ Optionally the event loop can return earlier on a \a timeout (in milliseconds). Returns true if the signal was emitted at least once in \a timeout milliseconds, otherwise returns false. + + Example: + \snippet code/doc_src_qsignalspy.cpp 5 */