QScrollEvent Class

스크롤할 때 QScrollEvent 클래스가 전송됩니다. 더 보기...

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

공용 형

enum ScrollState { ScrollStarted, ScrollUpdated, ScrollFinished }

공용 함수

QScrollEvent(const QPointF &contentPos, const QPointF &overshootDistance, QScrollEvent::ScrollState scrollState)
QPointF contentPos() const
QPointF overshootDistance() const
QScrollEvent::ScrollState scrollState() const

상세 설명

스크롤 이벤트는 수신자가 스크롤되어야 함을 나타내기 위해 전송됩니다. 일반적으로 수신자는 QWidget 또는 QGraphicsObject 과 같은 시각적인 것이어야 합니다.

두 소스에서 충돌하는 QScrollEvents가 전송되지 않도록 주의해야 합니다. 하지만 QScroller::scrollTo 을 사용하면 저장됩니다.

QScrollPrepareEventQScroller참조하세요 .

멤버 유형 문서

enum QScrollEvent::ScrollState

이 열거형은 스크롤 이벤트가 가질 수 있는 상태를 설명합니다.

Constant설명
QScrollEvent::ScrollStarted0스크롤 활동의 첫 번째 스크롤 이벤트에 대해 설정합니다.
QScrollEvent::ScrollUpdated1스크롤 활동의 첫 번째와 마지막 스크롤 이벤트를 제외한 모든 스크롤 이벤트에 대해 설정합니다.
QScrollEvent::ScrollFinished2스크롤 활동의 마지막 스크롤 이벤트에 대해 설정합니다.

QScrollEvent::scrollState()도 참조하세요 .

멤버 함수 문서

QScrollEvent::QScrollEvent(const QPointF &contentPos, const QPointF &overshootDistance, QScrollEvent::ScrollState scrollState)

새 QScrollEvent를 생성합니다. contentPos 는 새 콘텐츠 위치, overshootDistance 는 새 오버슈트 거리, scrollState 는 이 스크롤 이벤트가 첫 번째 이벤트인지, 마지막 이벤트인지 또는 그 사이의 이벤트인지를 나타냅니다.

QPointF QScrollEvent::contentPos() const

새 스크롤 위치를 반환합니다.

QPointF QScrollEvent::overshootDistance() const

새로운 오버슈트 거리를 반환합니다. 오버슈트라는 용어에 대한 설명은 QScroller 을 참조하십시오.

QScroller도 참조하세요 .

QScrollEvent::ScrollState QScrollEvent::scrollState() const

현재 스크롤 상태를 스크롤 상태 플래그 값의 조합으로 반환합니다. ScrollStarted (또는 ScrollFinished)가 설정됩니다. 이 스크롤 이벤트가 스크롤 활동의 첫 번째(또는 마지막) 이벤트인 경우. 활동이 단일 QScrollEvent 로 구성된 경우 두 값을 동시에 설정할 수 있습니다. 그 사이에 있는 다른 모든 스크롤 이벤트의 상태는 ScrollUpdated 로 설정됩니다.

예를 들어 위젯은 스크롤이 시작 및 중지될 때 선택 내용을 되돌릴 수 있습니다.

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