From 9022b0e50cac244790463905511ae5a868be3526 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 10 Nov 2010 11:28:36 +0100 Subject: Added an example for QTest::touchEvent to the documentation. Reviewed-by: trustme --- doc/src/snippets/code/src_qtestlib_qtestcase.cpp | 16 ++++++++++++++++ src/testlib/qtestcase.cpp | 3 +++ 2 files changed, 19 insertions(+) diff --git a/doc/src/snippets/code/src_qtestlib_qtestcase.cpp b/doc/src/snippets/code/src_qtestlib_qtestcase.cpp index 6ae8939..adb0c34 100644 --- a/doc/src/snippets/code/src_qtestlib_qtestcase.cpp +++ b/doc/src/snippets/code/src_qtestlib_qtestcase.cpp @@ -230,5 +230,21 @@ widget.show(); QTest::qWaitForWindowShown(&widget); //! [24] +//! [25] +QWidget widget; + +QTest::touchEvent(&widget) + .press(0, QPoint(10, 10)); +QTest::touchEvent(&widget) + .stationary(0) + .press(1, QPoint(40, 10)); +QTest::touchEvent(&widget) + .move(0, QPoint(12, 12)) + .move(1, QPoint(45, 5)); +QTest::touchEvent(&widget) + .release(0) + .release(1); +//! [25] + } diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 17f1a6b..e3a8726 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -755,6 +755,9 @@ QT_BEGIN_NAMESPACE QTest::touchEvent to create a QTouchEventSequence instance. Add touch events to the sequence by calling press(), move(), release() and stationary(), and let the instance run out of scope to commit the sequence to the event system. + + Example: + \snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 25 */ /*! -- cgit v0.12