このページでは

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)

xy で示されるポイントにitem を基準にtouchId を移動する。

ItemのデフォルトはtouchEvent()で指定された値。X と y のデフォルトはアイテムの中点です。

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

item から相対的にxy で示される点に、touchId として識別される新しい点を作成する。同じタッチポイントをさらに使用する場合は、同じ touchId を維持する必要があります。

ItemのデフォルトはtouchEvent()で指定された値である。Xとyのデフォルトはアイテムの中点である。

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

xy で示される点のitem からの相対位置でtouchId を削除する。

Item のデフォルトは 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.