![]() |
Qt 6.x
The Qt SDK
|
The QScrollPrepareEvent class is sent in preparation of scrolling. More...
#include <qevent.h>
Public Member Functions | |
QScrollPrepareEvent (const QPointF &startPos) | |
Creates new QScrollPrepareEvent The startPos is the position of a touch or mouse event that started the scrolling. | |
QPointF | startPos () const |
Returns the position of the touch or mouse event that started the scrolling. | |
QSizeF | viewportSize () const |
Returns size of the area that is to be scrolled as set by setViewportSize. | |
QRectF | contentPosRange () const |
Returns the range of coordinates for the content as set by setContentPosRange(). | |
QPointF | contentPos () const |
Returns the current position of the content as set by setContentPos. | |
void | setViewportSize (const QSizeF &size) |
Sets the size of the area that is to be scrolled to size. | |
void | setContentPosRange (const QRectF &rect) |
Sets the range of content coordinates to rect. | |
void | setContentPos (const QPointF &pos) |
Sets the current content position to pos. | |
![]() | |
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. | |
The QScrollPrepareEvent class is sent in preparation of scrolling.
\inmodule QtGui
The scroll prepare event is sent before scrolling (usually by QScroller) is started. The object receiving this event should set viewportSize, maxContentPos and contentPos. It also should accept this event to indicate that scrolling should be started.
It is not guaranteed that a QScrollEvent will be sent after an accepted QScrollPrepareEvent, e.g. in a case where the maximum content position is (0, 0).
|
explicit |
Creates new QScrollPrepareEvent The startPos is the position of a touch or mouse event that started the scrolling.
Definition at line 4584 of file qevent.cpp.
|
inline |
Returns the current position of the content as set by setContentPos.
Definition at line 960 of file qevent.h.
Referenced by operator<<(), and QScrollerPrivate::prepareScrolling().
|
inline |
Returns the range of coordinates for the content as set by setContentPosRange().
Definition at line 959 of file qevent.h.
Referenced by operator<<(), and QScrollerPrivate::prepareScrolling().
Sets the current content position to pos.
Definition at line 4639 of file qevent.cpp.
References pos.
Sets the range of content coordinates to rect.
Definition at line 4629 of file qevent.cpp.
References rect.
Sets the size of the area that is to be scrolled to size.
Definition at line 4619 of file qevent.cpp.
|
inline |
|
inline |
Returns size of the area that is to be scrolled as set by setViewportSize.
Definition at line 958 of file qevent.h.
Referenced by operator<<(), and QScrollerPrivate::prepareScrolling().