diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-11-10 10:28:36 (GMT) |
---|---|---|
committer | Ville Pernu <ville.pernu@nokia.com> | 2010-11-12 13:32:18 (GMT) |
commit | 18ac111fe5fafed5ac2b5db97def3be2a898df7e (patch) | |
tree | c5e014c8f41f1f33834f318468f6f338a06cfa2d | |
parent | 4f8d55c493db989984ec64bd05453e14d7a0cab2 (diff) | |
download | Qt-18ac111fe5fafed5ac2b5db97def3be2a898df7e.zip Qt-18ac111fe5fafed5ac2b5db97def3be2a898df7e.tar.gz Qt-18ac111fe5fafed5ac2b5db97def3be2a898df7e.tar.bz2 |
Added an example for QTest::touchEvent to the documentation.
Reviewed-by: trustme
-rw-r--r-- | doc/src/snippets/code/src_qtestlib_qtestcase.cpp | 16 | ||||
-rw-r--r-- | src/testlib/qtestcase.cpp | 3 |
2 files changed, 19 insertions, 0 deletions
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 */ /*! |