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 オブジェクトが破棄されたときに自動的に呼び出されます。
TouchEventSequence move(int touchId, object item, real x = item.width / 2, real y = item.height / 2) |
touchId を、x とy が示すポイントに、item に対して相対的に移動する。
ItemのデフォルトはtouchEvent()で指定された値。X と y のデフォルトはアイテムの中点。
TouchEventSequence press(int touchId, object item, real x = item.width / 2, real y = item.height / 2) |
touchId として識別される新しい点を、x とy で示される点から、item に相対する点に作成する。同じタッチポイントをさらに使用する場合は、同じ touchId を維持する必要があります。
ItemのデフォルトはtouchEvent()で指定された値である。XとYのデフォルトはアイテムの中間点である。
TouchEventSequence release(int touchId, object item, real x = item.width / 2, real y = item.height / 2) |
x とy で示される点で、item を基準にtouchId を削除する。
項目のデフォルトは touchEvent() で指定された値。X と y のデフォルトはアイテムの中点。
TouchEventSequence stationary(int touchId) |
touchId が存在することを示すが、それ以外は以前のイベントから変更されていない。
© 2025 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.