TouchEventSequence QML Type
터치 이벤트 시퀀스는 테스트를 위해 터치 이벤트를 빌드하고 디스패치하는 데 사용됩니다. 더 보기...
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)
상세 설명
TestCase.touchEvent()를 호출하여 TouchEventSequence를 생성합니다. 이 유형은 직접 인스턴스화할 수 없습니다. 유형에서 제공하는 각 메서드는 동일한 객체를 반환하므로 연쇄 호출이 가능합니다.
예를 들어
touchEvent(item).press(0).commit();
는 다음과 같습니다:
var sequence = touchEvent(item); sequence.press(0); sequence.commit();
이벤트는 터치 이벤트에 지정된 항목이 포함된 창으로 전달됩니다.
TestCase::touchEvent()도 참조하세요 .
메서드 문서
TouchEventSequence commit() |
press(), move(), release(), stationary()를 사용하여 미리 작성된 터치 이벤트를 전송합니다. 커밋이 반환된 후 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 item 를 및 에 의해 지정된 지점으로 이동합니다. x y
항목의 기본값은 터치이벤트()를 통해 제공된 값입니다. X와 Y는 기본적으로 항목의 중간 지점이 됩니다.
TouchEventSequence press(int touchId, object item, real x = item.width / 2, real y = item.height / 2) |
x 및 y 로 표시된 지점에 item 을 기준으로 touchId 으로 식별되는 새 지점을 만듭니다. 동일한 터치 포인트를 추가로 사용하면 동일한 터치아이디를 유지해야 합니다.
항목의 기본값은 터치이벤트()를 통해 제공된 값입니다. X와 Y는 기본적으로 항목의 중간 지점이 됩니다.
TouchEventSequence release(int touchId, object item, real x = item.width / 2, real y = item.height / 2) |
x 및 y 로 표시된 지점에서 item 을 기준으로 touchId 을 제거합니다.
항목의 기본값은 터치 이벤트()를 통해 제공된 값입니다. 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.