QNativeGestureEvent Class

제스처 이벤트를 설명하는 파라미터는 QNativeGestureEvent 클래스에 포함되어 있습니다. 더 보기...

Header: #include <QNativeGestureEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
상속합니다: QSinglePointEvent

공용 함수

(since 6.2) QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *device, int fingerCount, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, qreal value, const QPointF &delta, quint64 sequenceId = UINT64_MAX)
(since 6.2) QPointF delta() const
(since 6.2) int fingerCount() const
Qt::NativeGestureType gestureType() const
qreal value() const

상세 설명

네이티브 제스처 이벤트는 일반적으로 트랙패드 터치 이벤트를 해석하여 운영 체제에서 생성됩니다. 제스처 이벤트는 확대/축소, 회전, 이동과 같은 상위 레벨 이벤트입니다. value () 및 delta()은 이전 이벤트와 현재 이벤트의 차이를 제공하는 등 여러 유형이 증분 값을 보유합니다.

이벤트 유형설명터치 시퀀스
Qt::ZoomNativeGesture확대/축소 델타(퍼센트).macOS 및 Wayland: 두 손가락 핀치.
Qt::SmartZoomNativeGesture부울 확대 상태.macOS: 두 손가락 더블 탭(트랙패드) / 한 손가락 더블 탭(매직 마우스).
Qt::RotateNativeGesture회전 델타(도) 단위.macOS 및 Wayland: 두 손가락 회전.
Qt::SwipeNativeGesture스와이프 각도(도).macOS: 트랙패드 설정에서 구성할 수 있습니다.
Qt::PanNativeGesture변위 델타(픽셀).웨이랜드: 세 개 이상의 손가락이 그룹으로 어떤 방향으로든 움직입니다.

또한 제스처 이벤트 스트림 전후에 BeginNativeGesture 및 EndNativeGesture가 전송됩니다:

BeginNativeGesture 줌 네이티브 제스처 줌 네이티브 제스처 줌 네이티브 제스처 줌 네이티브 제스처 엔드 네이티브 제스처

이벤트 스트림에는 다양한 유형의 인터리브 제스처가 포함될 수 있습니다. 예를 들어 두 손가락 핀치 제스처는 줌 및 회전 이벤트 스트림을 생성하고, 플랫폼에 따라 PanNativeGesture가 이들과 인터리브될 수도 있습니다.

다른 유형은 독립형 이벤트입니다: 스마트 줌 네이티브 제스처와 스와이프 네이티브 제스처는 제스처가 감지될 때마다 한 번씩만 발생합니다.

참고: 터치패드에서 두 손가락을 한 그룹으로 움직이는 제스처(두 손가락 밀기 제스처)는 일반적으로 스크롤을 위해 예약되어 있으며, 이 경우 Qt는 QWheelEvents를 생성합니다. 이것이 팬 네이티브 제스처를 생성하기 위해 세 개 이상의 손가락이 필요한 이유입니다.

Qt::NativeGestureType, QGestureEvent, QWheelEvent참조하십시오 .

멤버 함수 문서

[since 6.2] QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *device, int fingerCount, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, qreal value, const QPointF &delta, quint64 sequenceId = UINT64_MAX)

fingerCount 손가락이 관련된 scenePos 의 제스처를 설명하는 device 에서 시작되는 type 유형의 네이티브 제스처 이벤트를 구성합니다.

localPos, scenePosglobalPos 포인트는 각각 수신 위젯 또는 항목, 창, 화면 또는 바탕화면을 기준으로 제스처 위치를 지정합니다.

value 는 제스처에 따라 해석이 달라집니다. 회전NativeGesture 또는 스와이프NativeGesture의 경우 각도 단위로 해석됩니다. 줌 네이티브 제스처의 경우 value 는 일반적으로 1보다 훨씬 작은 증분 배율로, 대상 항목의 배율을 다음과 같이 조정해야 함을 나타냅니다: item.scale = item.scale * (1 + event.value).

팬 네이티브 제스처의 경우 delta 는 뷰포트, 위젯 또는 항목이 이동 또는 패닝되어야 하는 픽셀 단위의 거리를 제공합니다.

참고: delta 는 단정밀도(QVector2D)로 저장되므로 delta()는 경우에 따라 약간 다른 값을 반환할 수 있습니다. 이는 향후 Qt 버전에서 변경될 수 있습니다.

이 함수는 Qt 6.2에 도입되었습니다.

[since 6.2] QPointF QNativeGestureEvent::delta() const

이전 이벤트 이후 이동한 거리를 픽셀 단위로 반환합니다. 이동 제스처는 대상 위젯, 항목 또는 뷰포트 콘텐츠가 이동해야 하는 거리를 픽셀 단위로 제공합니다.

이 기능은 Qt 6.2에 도입되었습니다.

QPanGesture::delta()도 참조하세요 .

[since 6.2] int QNativeGestureEvent::fingerCount() const

제스처에 참여한 손가락의 개수를 알 수 있는 경우 반환합니다. gestureType ()가 Qt::BeginNativeGesture 또는 Qt::EndNativeGesture 인 경우 이 정보를 알 수 없는 경우가 많으며, fingerCount()는 0 을 반환합니다.

이 함수는 Qt 6.2에 도입되었습니다.

Qt::NativeGestureType QNativeGestureEvent::gestureType() const

제스처 유형을 반환합니다.

qreal QNativeGestureEvent::value() const

제스처 값을 반환합니다. 이 값은 제스처 유형에 따라 해석되어야 합니다. 예를 들어 확대/축소 제스처는 배율 델타를 제공하고 회전 제스처는 회전 델타를 제공합니다.

QNativeGestureEventgestureType()도 참조하세요 .

© 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.