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의 제스처 처리에 대한 개요와 애플리케이션에서 제스처를 사용하는 방법에 대한 정보는 위젯과 그래픽 보기의 제 스처 문서를 참조하십시오.

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(제스처, true)를 호출하는 것과 동일).

수락 플래그를 설정하면 이벤트 수신자가 제스처를 원한다는 것을 나타냅니다. 원치 않는 제스처는 부모 위젯으로 전파될 수 있습니다.

QGestureEvent::ignore()도 참조하세요 .

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

주어진 gestureType 의 수락 플래그를 설정합니다( setAccepted(gestureType, true)를 호출하는 것과 동일).

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

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)

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

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

QGestureEvent::accept()도 참조하세요 .

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

setAccepted(제스처, false)를 호출하는 것과 동일한 gestureType 의 수락 플래그 매개변수를 지웁니다.

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

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(제스처)로 수락 플래그를 설정하고 ignore(제스처)로 지울 수도 있습니다.

isAccepted()도 참조하세요 .

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

지정된 gestureType 객체의 수락 플래그를 지정된 value 으로 설정합니다.

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

기본적으로 QEvent::Gesture 유형의 이벤트의 제스처는 수락되고 QEvent::GestureOverride 이벤트의 제스처는 무시됩니다.

편의를 위해 accept(gestureType)로 수락 플래그를 설정하고 ignore(gestureType)으로 지울 수도 있습니다.

QWidget *QGestureEvent::widget() const

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

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