이 페이지에서

QNativeGestureEvent Class

QNativeGestureEvent 클래스에는 제스처 이벤트를 설명하는 매개변수들이 포함되어 있습니다. 더 보기...

헤더: #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

보호된 함수

QNativeGestureEvent(QNativeGestureEvent &&)
QNativeGestureEvent &operator=(QNativeGestureEvent &&)
QNativeGestureEvent &operator=(const QNativeGestureEvent &other)

상세 설명

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

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

또한, 제스처 이벤트 스트림의 시작 전과 끝 후에 BeginNativeGesture 및 EndNativeGesture가 전송됩니다:

BeginNativeGesture ZoomNativeGesture ZoomNativeGesture ZoomNativeGesture EndNativeGesture

이벤트 스트림에는 서로 다른 유형의 제스처가 교차하여 포함될 수 있습니다. 예를 들어, 두 손가락 핀치 제스처는 Zoom 및 Rotate 이벤트 스트림을 생성하며, 플랫폼에 따라 PanNativeGesture가 때때로 이러한 이벤트와 교차하여 포함될 수 있습니다.

다른 유형의 제스처는 독립형 이벤트입니다. SmartZoomNativeGesture와 SwipeNativeGesture는 제스처가 감지될 때마다 각각 한 번씩만 발생합니다.

참고: 터치패드에서 두 손가락을 함께 움직이는 동작(두 손가락 플릭 제스처)은 대개 스크롤링 용도로 예약되어 있습니다. 이 경우 Qt는 QWheelEvents를 생성합니다. 이것이 바로 PanNativeGesture를 생성하기 위해 세 손가락 이상이 필요한 이유입니다.

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)

device 에서 발생한, type 유형의 네이티브 제스처 이벤트를 생성하며, 이 이벤트는 scenePos 에서 fingerCount 개의 손가락이 관여하는 제스처를 설명합니다.

점 localPos, scenePos 및 globalPos 은 각각 수신 위젯 또는 항목, 창, 화면 또는 데스크톱을 기준으로 한 제스처 위치를 지정합니다.

value 는 제스처에 따라 해석이 달라집니다. RotateNativeGesture 또는 SwipeNativeGesture의 경우, 이는 도(°) 단위의 각도입니다. ZoomNativeGesture의 경우, value 는 증분 스케일링 계수이며, 일반적으로 1보다 훨씬 작습니다. 이는 대상 항목의 스케일이 다음과 같이 조정되어야 함을 나타냅니다: item.scale = item.scale * (1 + event.value)

PanNativeGesture의 경우, ` delta `는 뷰포트, 위젯 또는 항목이 이동되거나 패닝되어야 하는 거리를 픽셀 단위로 나타냅니다.

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

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

[protected delete] QNativeGestureEvent::QNativeGestureEvent(QNativeGestureEvent &&)

QNativeGestureEvent 의 인스턴스를 move-construct로 생성합니다. 이 함수는 삭제되었습니다.

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

이전 이벤트 이후 이동한 거리를 픽셀 단위로 반환합니다. 팬(Pan) 제스처는 대상 위젯, 항목 또는 뷰포트 내용을 이동해야 할 픽셀 단위의 거리를 제공합니다.

이 함수는 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

제스처 값을 반환합니다. 이 값은 제스처 유형에 따라 해석해야 합니다. 예를 들어, 확대/축소(Zoom) 제스처는 확대/축소 비율의 변화를 제공하며, 회전(Rotate) 제스처는 회전 각도의 변화를 제공합니다.

QNativeGestureEvent 및 gestureType()도 참조하십시오 .

[protected delete] QNativeGestureEvent &QNativeGestureEvent::operator=(QNativeGestureEvent &&)

other 를 이 QNativeGestureEvent 인스턴스에 할당합니다. 이 함수는 삭제됩니다.

[noexcept protected default] QNativeGestureEvent &QNativeGestureEvent::operator=(const QNativeGestureEvent &other)

other 를 이 QNativeGestureEvent 인스턴스에 복사-할당합니다.

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