Struct qt_gui::QScrollEvent
source · #[repr(C)]pub struct QScrollEvent { /* private fields */ }
Expand description
The QScrollEvent class is sent when scrolling.
C++ class: QScrollEvent
.
The QScrollEvent class is sent when scrolling.
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.
Implementations§
source§impl QScrollEvent
impl QScrollEvent
sourcepub unsafe fn content_pos(&self) -> CppBox<QPointF>
pub unsafe fn content_pos(&self) -> CppBox<QPointF>
Returns the new scroll position.
Calls C++ function: QPointF QScrollEvent::contentPos() const
.
Returns the new scroll position.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QScrollEvent>>
) -> Ref<QScrollEvent>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QScrollEvent>> ) -> Ref<QScrollEvent>
The QScrollEvent class is sent when scrolling.
Calls C++ function: QScrollEvent& QScrollEvent::operator=(const QScrollEvent& other)
.
The QScrollEvent class is sent when scrolling.
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.
sourcepub unsafe fn new(
content_pos: impl CastInto<Ref<QPointF>>,
overshoot: impl CastInto<Ref<QPointF>>,
scroll_state: ScrollState
) -> CppBox<QScrollEvent>
pub unsafe fn new( content_pos: impl CastInto<Ref<QPointF>>, overshoot: impl CastInto<Ref<QPointF>>, scroll_state: ScrollState ) -> CppBox<QScrollEvent>
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.
Calls C++ function: [constructor] void QScrollEvent::QScrollEvent(const QPointF& contentPos, const QPointF& overshoot, QScrollEvent::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.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QScrollEvent>>
) -> CppBox<QScrollEvent>
pub unsafe fn new_copy( other: impl CastInto<Ref<QScrollEvent>> ) -> CppBox<QScrollEvent>
The QScrollEvent class is sent when scrolling.
Calls C++ function: [constructor] void QScrollEvent::QScrollEvent(const QScrollEvent& other)
.
The QScrollEvent class is sent when scrolling.
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.
sourcepub unsafe fn overshoot_distance(&self) -> CppBox<QPointF>
pub unsafe fn overshoot_distance(&self) -> CppBox<QPointF>
Returns the new overshoot distance. See QScroller for an explanation of the term overshoot.
Calls C++ function: QPointF QScrollEvent::overshootDistance() const
.
sourcepub unsafe fn scroll_state(&self) -> ScrollState
pub unsafe fn scroll_state(&self) -> ScrollState
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.
Calls C++ function: QScrollEvent::ScrollState QScrollEvent::scrollState() const
.
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.
Methods from Deref<Target = QEvent>§
sourcepub unsafe fn accept(&self)
pub unsafe fn accept(&self)
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Calls C++ function: void QEvent::accept()
.
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget.
See also ignore().
sourcepub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
Calls C++ function: QEvent& QEvent::operator=(const QEvent& other)
.
sourcepub unsafe fn ignore(&self)
pub unsafe fn ignore(&self)
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
Calls C++ function: void QEvent::ignore()
.
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propagated to the parent widget.
See also accept().
sourcepub unsafe fn is_accepted(&self) -> bool
pub unsafe fn is_accepted(&self) -> bool
the accept flag of the event object
Calls C++ function: bool QEvent::isAccepted() const
.
the accept flag of the event object
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept(), and cleared with ignore().
Access functions:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
sourcepub unsafe fn set_accepted(&self, accepted: bool)
pub unsafe fn set_accepted(&self, accepted: bool)
the accept flag of the event object
Calls C++ function: void QEvent::setAccepted(bool accepted)
.
the accept flag of the event object
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept(), and cleared with ignore().
Access functions:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
sourcepub unsafe fn spontaneous(&self) -> bool
pub unsafe fn spontaneous(&self) -> bool
Returns true
if the event originated outside the application (a system event); otherwise returns false
.
Calls C++ function: bool QEvent::spontaneous() const
.
Returns true
if the event originated outside the application (a system event); otherwise returns false
.
The return value of this function is not defined for paint events.
Trait Implementations§
source§impl CppDeletable for QScrollEvent
impl CppDeletable for QScrollEvent
source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys QScrollEvent.
Calls C++ function: virtual [destructor] void QScrollEvent::~QScrollEvent()
.
Destroys QScrollEvent.
source§impl Deref for QScrollEvent
impl Deref for QScrollEvent
source§impl DynamicCast<QScrollEvent> for QEvent
impl DynamicCast<QScrollEvent> for QEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QScrollEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QScrollEvent>
Calls C++ function: QScrollEvent* dynamic_cast<QScrollEvent*>(QEvent* ptr)
.
source§impl StaticDowncast<QScrollEvent> for QEvent
impl StaticDowncast<QScrollEvent> for QEvent
source§unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QScrollEvent>
unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QScrollEvent>
Calls C++ function: QScrollEvent* static_cast<QScrollEvent*>(QEvent* ptr)
.
source§impl StaticUpcast<QEvent> for QScrollEvent
impl StaticUpcast<QEvent> for QScrollEvent
source§unsafe fn static_upcast(ptr: Ptr<QScrollEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QScrollEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QScrollEvent* ptr)
.