Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
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. | |
Public Member Functions inherited from QEvent | |
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 Public Member Functions inherited from QEvent | |
static int | registerEventType (int hint=-1) noexcept |
Protected Member Functions inherited from QEvent | |
QT_DEFINE_TAG_STRUCT (InputEventTag) | |
QEvent (Type type, InputEventTag) | |
QT_DEFINE_TAG_STRUCT (PointerEventTag) | |
QEvent (Type type, PointerEventTag) | |
QT_DEFINE_TAG_STRUCT (SinglePointEventTag) | |
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 & | 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 4688 of file qevent.cpp.
|
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.