이 페이지에서

QGestureEvent Class

QGestureEvent 클래스는 트리거된 제스처에 대한 설명을 제공합니다. 더 보기...

헤더: #include <QGestureEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
상속: QEvent

공개 함수

QGestureEvent(const QList<QGesture *> &gestures)
virtual ~QGestureEvent()
void accept(QGesture *gesture)
void accept(Qt::GestureType gestureType)
QList<QGesture *> activeGestures() const
QList<QGesture *> canceledGestures() const
QGesture *gesture(Qt::GestureType type) const
QList<QGesture *> gestures() const
void ignore(QGesture *gesture)
void ignore(Qt::GestureType gestureType)
bool isAccepted(QGesture *gesture) const
bool isAccepted(Qt::GestureType gestureType) const
QPointF mapToGraphicsScene(const QPointF &gesturePoint) const
void setAccepted(QGesture *gesture, bool value)
void setAccepted(Qt::GestureType gestureType, bool value)
QWidget *widget() const

상세 설명

QGestureEvent 클래스에는 제스처 목록이 포함되어 있으며, 이 목록은 gestures() 함수를 사용하여 얻을 수 있습니다.

제스처는 활성 상태이거나 취소된 상태입니다. 현재 실행 중인 제스처 목록은 activeGestures() 함수를 사용하여 얻을 수 있습니다. 이전에 활성화되었다가 취소된 제스처 목록은 canceledGestures() 함수를 사용하여 확인할 수 있습니다. 제스처는 예를 들어 현재 창의 포커스가 사라지거나, 타임아웃이 발생하거나, 그 밖의 다른 이유로 취소될 수 있습니다.

이벤트 핸들러가 일반 함수인 QEvent::accept()를 호출하여 이벤트를 수락하지 않으면, 수락되지 않고 Qt::GestureStarted 상태에 있는 모든 개별 QGesture 객체는 위젯 체인을 따라 상위 위젯으로 전파됩니다. 이 과정에서 각 객체에 대해 QGestureEvent::accept()를 호출하여 개별적으로 수락하거나, 이벤트 필터가 해당 이벤트를 처리할 때까지 전파가 계속됩니다.

추가 정보

Qt Widgets에서의 제스처 처리 개요 및 애플리케이션에서 제스처를 사용하는 방법에 대한 정보는 '위젯 및 그래픽 뷰의 제스처(Gestures in Widgets and Graphics View )' 문서를 참조하십시오.

또한 QGesture, QGestureRecognizer, QWidget::grabGesture(), QGraphicsObject::grabGesture()을참조하십시오 .

멤버 함수 문서

[explicit] QGestureEvent::QGestureEvent(const QList<QGesture *> &gestures)

gestures 의 목록을 포함하는 새로운 QGestureEvent를 생성합니다.

[virtual noexcept] QGestureEvent::~QGestureEvent()

QGestureEvent 를 삭제합니다.

void QGestureEvent::accept(QGesture *gesture)

지정된 ` gesture ` 객체의 수락 플래그를 설정하며, 이는 ` setAccepted(gesture, true)`를 호출하는 것과 동일합니다.

accept 플래그를 설정하면 이벤트 수신자가 해당 제스처를 수락하고자 함을 나타냅니다. 원하지 않는 제스처는 상위 위젯으로 전파될 수 있습니다.

QGestureEvent::ignore()도 참조하십시오 .

void QGestureEvent::accept(Qt::GestureType gestureType)

지정된 이벤트 수신기( gestureType)의 accept 플래그를 설정합니다. 이는 setAccepted(gestureType, true)를 호출하는 것과 동일합니다.

accept 플래그를 설정하면 이벤트 수신자가 해당 제스처를 허용함을 나타냅니다. 원하지 않는 제스처는 상위 위젯으로 전파될 수 있습니다.

QGestureEvent::ignore()도 참조하십시오 .

QList<QGesture *> QGestureEvent::activeGestures() const

활성 상태(취소되지 않은) 제스처 목록을 반환합니다.

QList<QGesture *> QGestureEvent::canceledGestures() const

취소된 제스처의 목록을 반환합니다.

QGesture *QGestureEvent::gesture(Qt::GestureType type) const

type 에 따라 제스처 객체를 반환합니다.

QList<QGesture *> QGestureEvent::gestures() const

이벤트를 통해 전달된 모든 제스처를 반환합니다.

void QGestureEvent::ignore(QGesture *gesture)

지정된 ` gesture ` 객체의 '수락' 플래그 매개변수를 지웁니다. 이는 ` setAccepted(gesture, false)`를 호출하는 것과 동일합니다.

accept 플래그를 지우면 이벤트 수신자가 해당 제스처를 원하지 않음을 나타냅니다. 원하지 않는 제스처는 상위 위젯으로 전파될 수 있습니다.

QGestureEvent::accept()도 참조하십시오 .

void QGestureEvent::ignore(Qt::GestureType gestureType)

지정된 이벤트 수신기( gestureType)의 수락 플래그 매개변수를 지웁니다. 이는 setAccepted(gesture, false)를 호출하는 것과 동일합니다.

accept 플래그를 지우면 이벤트 수신자가 해당 제스처를 원하지 않음을 나타냅니다. 원하지 않는 제스처는 상위 위젯으로 전파될 수 있습니다.

QGestureEvent::accept()도 참조하십시오 .

bool QGestureEvent::isAccepted(QGesture *gesture) const

gesture 가 허용되면 ` true `를 반환하고, 그렇지 않으면 ` false`를 반환합니다.

bool QGestureEvent::isAccepted(Qt::GestureType gestureType) const

gestureType 유형의 제스처가 허용되면 ` true `를 반환하고, 그렇지 않으면 ` false`를 반환합니다.

QPointF QGestureEvent::mapToGraphicsScene(const QPointF &gesturePoint) const

gesturePoint 가 그래픽 뷰 내에 있는 경우, 씬 로컬 좌표를 반환합니다.

이 함수는 제스처 이벤트가 QGraphicsObject 에 전달되었을 때, 화면 좌표계의 점을 씬 로컬 좌표계로 변환하는 데 유용할 수 있습니다.

QPointF::isNull()도 참조하십시오 .

void QGestureEvent::setAccepted(QGesture *gesture, bool value)

지정된 이벤트 수신기( gesture ) 객체의 수락 플래그를 지정된 이벤트 수신기( value)로 설정합니다.

수락 플래그를 설정하면 이벤트 수신자가 ` gesture`를 원함을 나타냅니다. 원하지 않는 제스처는 상위 위젯으로 전파될 수 있습니다.

기본적으로 ` QEvent::Gesture ` 유형의 이벤트에 포함된 제스처는 수락되며, ` QEvent::GestureOverride ` 이벤트에 포함된 제스처는 무시됩니다.

편의를 위해 accept 플래그는 accept(gesture)를 사용하여 설정할 수도 있고, ignore(gesture)를 사용하여 해제할 수도 있습니다.

isAccepted()도 참조하십시오 .

void QGestureEvent::setAccepted(Qt::GestureType gestureType, bool value)

지정된 ` gestureType ` 객체의 `accept` 플래그를 지정된 ` value` 값으로 설정합니다.

수락 플래그를 설정하면 이벤트 수신자가 지정된 유형( gestureType)의 제스처를 수신하고자 함을 나타냅니다. 원하지 않는 제스처는 상위 위젯으로 전파될 수 있습니다.

기본적으로 QEvent::Gesture 유형의 이벤트에 포함된 제스처는 허용되며, QEvent::GestureOverride 이벤트에 포함된 제스처는 무시됩니다.

편의상, accept 플래그는 accept(gestureType)을 사용하여 설정할 수 있으며, ignore(gestureType)을 사용하여 해제할 수 있습니다.

QWidget *QGestureEvent::widget() const

이벤트가 발생한 위젯을 반환합니다.

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