The QTouchEventSequence class is used to simulate a sequence of touch events. More...
#include <QTest>
This class was introduced in Qt 4.6.
~QTouchEventSequence () | |
QTouchEventSequence & | move ( int touchId, const QPoint & pt, QWidget * widget = 0 ) |
QTouchEventSequence & | press ( int touchId, const QPoint & pt, QWidget * widget = 0 ) |
QTouchEventSequence & | release ( int touchId, const QPoint & pt, QWidget * widget = 0 ) |
QTouchEventSequence & | stationary ( int touchId ) |
The QTouchEventSequence class is used to simulate a sequence of touch events.
To simulate a sequence of touch events on a specific device for a widget, call 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:
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);
Commits this sequence of touch events and frees allocated resources.
Adds a move event for touchpoint touchId at position pt to this sequence and returns a reference to this QTouchEventSequence.
The position pt is interpreted as relative to widget. If widget is the null pointer, then pt is interpreted as relative to the widget provided when instantiating this QTouchEventSequence.
Simulates that the user moved the finger identified by touchId.
Adds a press event for touchpoint touchId at position pt to this sequence and returns a reference to this QTouchEventSequence.
The position pt is interpreted as relative to widget. If widget is the null pointer, then pt is interpreted as relative to the widget provided when instantiating this QTouchEventSequence.
Simulates that the user pressed the touch screen or pad with the finger identified by touchId.
Adds a release event for touchpoint touchId at position pt to this sequence and returns a reference to this QTouchEventSequence.
The position pt is interpreted as relative to widget. If widget is the null pointer, then pt is interpreted as relative to the widget provided when instantiating this QTouchEventSequence.
Simulates that the user lifted the finger identified by touchId.
Adds a stationary event for touchpoint touchId to this sequence and returns a reference to this QTouchEventSequence.
Simulates that the user did not move the finger identified by touchId.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.