QtBase
v6.3.1
|
The QScrollEvent class is sent when scrolling. More...
#include <qevent.h>
Public Member Functions | |
QScrollEvent (const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState) | |
~QScrollEvent () | |
QScrollEvent * | clone () const override |
QPointF | contentPos () const |
QPointF | overshootDistance () const |
ScrollState | scrollState () const |
Public Member Functions inherited from QEvent | |
QEvent (Type type) | |
virtual | ~QEvent () |
Type | type () const |
bool | spontaneous () const |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
void | ignore () |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
Additional Inherited Members | |
Static Public Member Functions inherited from QEvent | |
static int | registerEventType (int hint=-1) noexcept |
Protected Member Functions inherited from QEvent | |
QEvent (Type type, InputEventTag) | |
QEvent (Type type, PointerEventTag) | |
QEvent (Type type, SinglePointEventTag) | |
Protected Attributes inherited from QEvent | |
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 & | overshootDistance, | ||
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 4774 of file qevent.cpp.
QScrollEvent::~QScrollEvent | ( | ) |
Destroys QScrollEvent.
Definition at line 4782 of file qevent.cpp.
|
inlineoverridevirtual |
|
inline |
|
inline |
|
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 1102 of file qevent.h.