QScrollEvent¶
The
QScrollEvent
class is sent when scrolling. More…
Synopsis¶
Functions¶
def
contentPos
()def
overshootDistance
()def
scrollState
()
Detailed Description¶
The scroll event is sent to indicate that the receiver should be scrolled. Usually the receiver should be something visual like
QWidget
orQGraphicsObject
.Some care should be taken that no conflicting QScrollEvents are sent from two sources. Using
scrollTo
is save however.See also
QScrollPrepareEvent
QScroller
- class PySide2.QtGui.QScrollEvent(contentPos, overshoot, scrollState)¶
- param overshoot:
- param scrollState:
- param contentPos:
Creates a new
QScrollEvent
contentPos
is the new content position,overshootDistance
is the new overshoot distance whilescrollState
indicates if this scroll event is the first one, the last one or some event in between.
- PySide2.QtGui.QScrollEvent.ScrollState¶
This enum describes the states a scroll event can have.
Constant
Description
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.
See also
- PySide2.QtGui.QScrollEvent.contentPos()¶
- Return type:
Returns the new scroll position.
- PySide2.QtGui.QScrollEvent.overshootDistance()¶
- Return type:
Returns the new overshoot distance. See
QScroller
for an explanation of the term overshoot.See also
QScroller
- PySide2.QtGui.QScrollEvent.scrollState()¶
- Return type:
Returns the current scroll state as a combination of ScrollStateFlag values.
ScrollStarted
(orScrollFinished
) 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 singleQScrollEvent
. All other scroll events in between will have their state set toScrollUpdated
.A widget could for example revert selections when scrolling is started and stopped.
© 2022 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.