The QScrollPrepareEvent class is sent in preparation of scrolling. More...
|CMake:|| find_package(Qt6 REQUIRED COMPONENTS Gui) |
target_link_libraries(mytarget PRIVATE Qt6::Gui)
|qmake:||QT += gui|
|QScrollPrepareEvent(const QPointF &startPos)|
|void||setContentPos(const QPointF &pos)|
|void||setContentPosRange(const QRectF &rect)|
|void||setViewportSize(const QSizeF &size)|
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).
Member Function Documentation
QScrollPrepareEvent::QScrollPrepareEvent(const QPointF &startPos)
Creates new QScrollPrepareEvent The startPos is the position of a touch or mouse event that started the scrolling.
QPointF QScrollPrepareEvent::contentPos() const
Returns the current position of the content as set by setContentPos.
See also setContentPos().
QRectF QScrollPrepareEvent::contentPosRange() const
Returns the range of coordinates for the content as set by setContentPosRange().
See also setContentPosRange().
void QScrollPrepareEvent::setContentPos(const QPointF &pos)
Sets the current content position to pos.
See also contentPos().
void QScrollPrepareEvent::setContentPosRange(const QRectF &rect)
Sets the range of content coordinates to rect.
See also contentPosRange().
void QScrollPrepareEvent::setViewportSize(const QSizeF &size)
Sets the size of the area that is to be scrolled to size.
See also viewportSize().
QPointF QScrollPrepareEvent::startPos() const
Returns the position of the touch or mouse event that started the scrolling.
QSizeF QScrollPrepareEvent::viewportSize() const
Returns size of the area that is to be scrolled as set by setViewportSize
See also setViewportSize().
© 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.