TouchEventSequence QML Type
TouchEventSequence は、テスト用にタッチイベントを生成・ディスパッチするために使用されます。詳細...
| Import Statement: | 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() を呼び出すことで生成されます。この型は直接インスタンス化することはできません。この型が提供する各メソッドは同じオブジェクトを返すため、メソッドの連鎖呼び出しが可能です。
例:
touchEvent(item).press(0).commit();は、以下と同等です:
var sequence = touchEvent(item);
sequence.press(0);
sequence.commit();イベントは、touchEventで指定されたアイテムを含むウィンドウに配信されます。
TestCase::touchEvent()も参照してください 。
メソッドのドキュメント
TouchEventSequence commit()
press()、move()、release()、およびstationary()を事前に使用して構成されたタッチイベントを送信します。commitの戻り値を受け取った後、TouchEventSequence を使用して新しいイベントを構成することができます。
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();TouchEventSequence オブジェクトが破棄されると、Commitが自動的に呼び出されます。
TouchEventSequence move(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
touchId を、item を基準として、x およびy で指定された位置に移動します。
項目の値は、touchEvent() を通じて指定された値がデフォルトとなります。X および y の値は、項目の中心点がデフォルトとなります。
TouchEventSequence press(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
`touchId` として識別される新しいポイントを作成します。このポイントは、`item` を基準として、`x ` および `y ` で指定された位置に配置されます。同じタッチポイントを再度使用した場合でも、同じ `touchId` が維持される必要があります。
Item の値は、touchEvent() を通じて提供された値がデフォルトとなります。X および y は、アイテムの中点がデフォルトとなります。
TouchEventSequence release(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
item を基準として、x およびy で指定された位置にある「touchId 」を削除します。
項目のデフォルト値は、touchEvent() を通じて提供された値になります。X および y のデフォルト値は、項目の中心点になります。
TouchEventSequence stationary(int touchId)
「touchId 」が存在することを示していますが、それ以外は以前のイベントと変わりません。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.