Struct rute::auto::drag_move_event::DragMoveEvent
source · pub struct DragMoveEvent<'a> { /* private fields */ }
Expand description
Notice these docs are heavy WIP and not very relevent yet
A widget will receive drag move events repeatedly while the drag is within its boundaries, if it accepts drop events and enter events . The widget should examine the event to see what kind of data it provides, and call the accept() function to accept the drop if appropriate.
The rectangle supplied by the answerRect() function can be used to restrict drops to certain parts of the widget. For example, we can check whether the rectangle intersects with the geometry of a certain child widget and only call acceptProposedAction() if that is the case.
Note that this class inherits most of its functionality from QDropEvent.
See also: DragEnterEvent
DragLeaveEvent
DropEvent
Licence
The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Implementations
sourceimpl<'a> DragMoveEvent<'a>
impl<'a> DragMoveEvent<'a>
sourcepub fn answer_rect(&self) -> Rect<'_>
pub fn answer_rect(&self) -> Rect<'_>
Returns the rectangle in the widget where the drop will occur if accepted. You can use this information to restrict drops to certain places on the widget.
sourcepub fn accept(&self) -> &Self
pub fn accept(&self) -> &Self
The same as accept(), but also notifies that future moves will also be acceptable if they remain within the rectangle given on the widget. This can improve performance, but may also be ignored by the underlying system.
If the rectangle is empty, drag move events will be sent continuously. This is useful if the source is scrolling in a timer event.
Overloads Calls QDropEvent::accept().
sourcepub fn ignore(&self) -> &Self
pub fn ignore(&self) -> &Self
Overloads Calls QDropEvent::ignore().
The opposite of the accept(const QRect&) function. Moves within the rectangle are not acceptable, and will be ignored.
sourcepub fn accept_2<R: RectTrait<'a>>(&self, r: &R) -> &Self
pub fn accept_2<R: RectTrait<'a>>(&self, r: &R) -> &Self
The same as accept(), but also notifies that future moves will also be acceptable if they remain within the rectangle given on the widget. This can improve performance, but may also be ignored by the underlying system.
If the rectangle is empty, drag move events will be sent continuously. This is useful if the source is scrolling in a timer event.
Overloads Calls QDropEvent::accept().
Trait Implementations
sourceimpl<'a> Clone for DragMoveEvent<'a>
impl<'a> Clone for DragMoveEvent<'a>
sourcefn clone(&self) -> DragMoveEvent<'a>
fn clone(&self) -> DragMoveEvent<'a>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more