Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QTouchEventSequence Class

(QTest::QTouchEventSequence)

The QTouchEventSequence class is used to simulate a sequence of touch events. More...

 #include <QTest>

This class was introduced in Qt 4.6.

Public Functions

~QTouchEventSequence()
void commit(bool processEvents = true)
QTouchEventSequence & move(int touchId, const QPoint & pt, QWindow * window = 0)
QTouchEventSequence & move(int touchId, const QPoint & pt, QWidget * widget = 0)
QTouchEventSequence & press(int touchId, const QPoint & pt, QWindow * window = 0)
QTouchEventSequence & press(int touchId, const QPoint & pt, QWidget * widget = 0)
QTouchEventSequence & release(int touchId, const QPoint & pt, QWindow * window = 0)
QTouchEventSequence & release(int touchId, const QPoint & pt, QWidget * widget = 0)
QTouchEventSequence & stationary(int touchId)

Static Public Members

QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint & pt)
QList<struct QWindowSystemInterface::TouchPoint> touchPointList(const QList<QTouchEvent::TouchPoint> & pointList)

Detailed Description

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 window or 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);

Member Function Documentation

QTouchEventSequence::~QTouchEventSequence()

Commits this sequence of touch events, unless autoCommit was disabled, and frees allocated resources.

void QTouchEventSequence::commit(bool processEvents = true)

Commits this sequence of touch events to the event system. Normally there is no need to call this function because it is called from the destructor. However, if autoCommit is disabled, the events only get committed upon explicitly calling this function.

In special cases tests may want to disable the processing of the events. This can be achieved by setting processEvents to false. This results in merely queuing the events, the event loop will not be forced to process them.

QTouchEventSequence & QTouchEventSequence::move(int touchId, const QPoint & pt, QWindow * window = 0)

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 window. If widnow is the null pointer, then pt is interpreted as relative to the window provided when instantiating this QTouchEventSequence.

Simulates that the user moved the finger identified by touchId.

This function was introduced in Qt 5.0.

QTouchEventSequence & QTouchEventSequence::move(int touchId, const QPoint & pt, QWidget * widget = 0)

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.

QTouchEventSequence & QTouchEventSequence::press(int touchId, const QPoint & pt, QWindow * window = 0)

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 window. If window is the null pointer, then pt is interpreted as relative to the window provided when instantiating this QTouchEventSequence.

Simulates that the user pressed the touch screen or pad with the finger identified by touchId.

This function was introduced in Qt 5.0.

QTouchEventSequence & QTouchEventSequence::press(int touchId, const QPoint & pt, QWidget * widget = 0)

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.

QTouchEventSequence & QTouchEventSequence::release(int touchId, const QPoint & pt, QWindow * window = 0)

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 window. If window is the null pointer, then pt is interpreted as relative to the window provided when instantiating this QTouchEventSequence.

Simulates that the user lifted the finger identified by touchId.

This function was introduced in Qt 5.0.

QTouchEventSequence & QTouchEventSequence::release(int touchId, const QPoint & pt, QWidget * widget = 0)

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.

QTouchEventSequence & QTouchEventSequence::stationary(int 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.

QWindowSystemInterface::TouchPoint QTouchEventSequence::touchPoint(const QTouchEvent::TouchPoint & pt) [static]

QList<struct QWindowSystemInterface::TouchPoint> QTouchEventSequence::touchPointList(const QList<QTouchEvent::TouchPoint> & pointList) [static]

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web