![]() |
Qt 6.x
The Qt SDK
|
The QScrollEvent class is sent when scrolling. More...
#include <qevent.h>
Public Member Functions | |
QScrollEvent (const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState) | |
Creates a new 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. | |
QPointF | contentPos () const |
Returns the new scroll position. | |
QPointF | overshootDistance () const |
Returns the new overshoot distance. | |
ScrollState | scrollState () const |
Returns the current scroll state as a combination of ScrollStateFlag values. | |
![]() | |
QEvent (Type type) | |
Constructs an event object of type type. | |
virtual | ~QEvent () |
Destroys the event. | |
Type | type () const |
Returns the event type. | |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false . | |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). | |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
virtual QEvent * | clone () const |
Creates and returns an identical copy of this event. | |
Additional Inherited Members | |
![]() | |
static int | registerEventType (int hint=-1) noexcept |
![]() | |
QEvent (Type type, InputEventTag) | |
QEvent (Type type, PointerEventTag) | |
QEvent (Type type, SinglePointEventTag) | |
![]() | |
quint16 | t |
The QScrollEvent class is sent when scrolling.
\inmodule QtGui
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 QScroller::scrollTo is save however.
This enum describes the states a scroll event can have.
\value ScrollStarted Set for the first scroll event of a scroll activity.
\value ScrollUpdated Set for all but the first and the last scroll event of a scroll activity.
\value ScrollFinished Set for the last scroll event of a scroll activity.
Enumerator | |
---|---|
ScrollStarted | |
ScrollUpdated | |
ScrollFinished |
QScrollEvent::QScrollEvent | ( | const QPointF & | contentPos, |
const QPointF & | overshoot, | ||
ScrollState | scrollState | ||
) |
Creates a new 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.
Definition at line 4682 of file qevent.cpp.
|
inline |
Returns the new scroll position.
Definition at line 987 of file qevent.h.
Referenced by operator<<().
|
inline |
Returns the new overshoot distance.
See QScroller for an explanation of the term overshoot.
Definition at line 988 of file qevent.h.
Referenced by operator<<().
|
inline |
Returns the current scroll state as a combination of ScrollStateFlag values.
ScrollStarted (or 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.
Definition at line 989 of file qevent.h.
Referenced by operator<<().