TouchEventSequence QML 類型

TouchEventSequence 用於構建和分派觸摸事件為測試。 更多...

import 語句: import QtTest

方法

  • TouchEventSequence commit ()
  • TouchEventSequence move (int touchId , object item , real x , real y )
  • TouchEventSequence press (int touchId , object item , real x , real y )
  • TouchEventSequence release (int touchId , object item , real x , real y )
  • TouchEventSequence stationary (int touchId )

詳細描述

TouchEventSequence 的創建是通過調用 TestCase.touchEvent (). The type can not be directly instantiated. Each method provided by the type returns the same object, allowing chained calls.

例如:

touchEvent(item).press(0).commit();
					

相當於:

var sequence = touchEvent(item);
sequence.press(0);
sequence.commit();
					

Events are delivered to the window which contains the item specified in touchEvent.

另請參閱 TestCase::touchEvent ().

方法文檔編製

TouchEventSequence commit ()

Sends the touch event composed by prior use of press (), move (), release (),和 stationary (). Following commit's return, the TouchEventSequence can be used to compose a new event.

var sequence = touchEvent(target);
// Touch the middle of target with 1 point
sequence.press(1);
sequence.commit();
// Begin a new event
// Move the point to target's upper left corner
sequence.move(1, target, 0, 0);
sequence.commit();
					

Commit is automatically invoked when the TouchEventSequence 對象被銷毀。

TouchEventSequence move ( int touchId , object item , real x = item.width / 2, real y = item.height / 2)

移動 touchId to the point indicated by x and y relative to item .

Item defaults to the value provided via touchEvent(). X and y default to the midpoint of the item.

TouchEventSequence press ( int touchId , object item , real x = item.width / 2, real y = item.height / 2)

Creates a new point identified as touchId , at the point indicated by x and y relative to item . Further use of the same touch point should maintain the same touchId.

Item defaults to the value provided via touchEvent(). X and y default to the midpoint of the item.

TouchEventSequence release ( int touchId , object item , real x = item.width / 2, real y = item.height / 2)

移除 touchId at the point indicated by x and y relative to item .

Item defaults to the value provided via touchEvent(). X and y default to the midpoint of the item.

TouchEventSequence stationary ( int touchId )

指示 touchId is present but otherwise unchanged from prior events.