内容表

上一话题

QScreen

下一话题

QScrollPrepareEvent

QScrollEvent

QScrollEvent class is sent when scrolling. 更多

Inheritance diagram of PySide2.QtGui.QScrollEvent

详细描述

The scroll event is sent to indicate that the receiver should be scrolled. Usually the receiver should be something visual like QWidget or QGraphicsObject .

Some care should be taken that no conflicting QScrollEvents are sent from two sources. Using scrollTo is save however.

另请参阅

QScrollPrepareEvent QScroller

class QScrollEvent ( contentPos , overshoot , scrollState )
param overshoot

QPointF

param scrollState

ScrollState

param contentPos

QPointF

创建新 QScrollEvent contentPos is the new content position, overshootDistance is the new overshoot distance while scrollState indicates if this scroll event is the first one, the last one or some event in between.

PySide2.QtGui.QScrollEvent. ScrollState

此枚举描述卷动事件可拥有的状态。

常量

描述

QScrollEvent.ScrollStarted

Set for the first scroll event of a scroll activity.

QScrollEvent.ScrollUpdated

Set for all but the first and the last scroll event of a scroll activity.

QScrollEvent.ScrollFinished

Set for the last scroll event of a scroll activity.

另请参阅

scrollState()

PySide2.QtGui.QScrollEvent. contentPos ( )
返回类型

QPointF

返回新卷动位置。

PySide2.QtGui.QScrollEvent. overshootDistance ( )
返回类型

QPointF

返回新过冲距离。见 QScroller for an explanation of the term overshoot.

另请参阅

QScroller

PySide2.QtGui.QScrollEvent. scrollState ( )
返回类型

ScrollState

Returns the current scroll state as a combination of ScrollStateFlag values. ScrollStarted (或 ScrollFinished ) will be set, if this scroll event is the first (or last) event in a scrolling activity. Please note that both values can be set at the same time, if the activity consists of a single QScrollEvent . All other scroll events in between will have their state set to ScrollUpdated .

A widget could for example revert selections when scrolling is started and stopped.