[][src]Struct qt_gui::QDragMoveEvent

#[repr(C)]pub struct QDragMoveEvent { /* fields omitted */ }

The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress.

C++ class: QDragMoveEvent.

C++ documentation:

The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress.

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.

Methods

impl QDragMoveEvent[src]

pub unsafe fn accept_0a(&self)[src]

This is an overloaded function.

Calls C++ function: void QDragMoveEvent::accept().

C++ documentation:

This is an overloaded function.

Calls QDropEvent::accept().

pub unsafe fn accept_1a(&self, r: impl CastInto<Ref<QRect>>)[src]

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.

Calls C++ function: void QDragMoveEvent::accept(const QRect& r).

C++ documentation:

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.

pub unsafe fn answer_rect(&self) -> CppBox<QRect>[src]

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.

Calls C++ function: QRect QDragMoveEvent::answerRect() const.

C++ documentation:

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.

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QDragMoveEvent>>
) -> Ref<QDragMoveEvent>
[src]

The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress.

Calls C++ function: QDragMoveEvent& QDragMoveEvent::operator=(const QDragMoveEvent& other).

C++ documentation:

The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress.

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.

pub unsafe fn ignore_0a(&self)[src]

This is an overloaded function.

Calls C++ function: void QDragMoveEvent::ignore().

C++ documentation:

This is an overloaded function.

Calls QDropEvent::ignore().

pub unsafe fn ignore_1a(&self, r: impl CastInto<Ref<QRect>>)[src]

The opposite of the accept(const QRect&) function. Moves within the rectangle are not acceptable, and will be ignored.

Calls C++ function: void QDragMoveEvent::ignore(const QRect& r).

C++ documentation:

The opposite of the accept(const QRect&) function. Moves within the rectangle are not acceptable, and will be ignored.

pub unsafe fn new_6a(
    pos: impl CastInto<Ref<QPoint>>,
    actions: QFlags<DropAction>,
    data: impl CastInto<Ptr<QMimeData>>,
    buttons: QFlags<MouseButton>,
    modifiers: QFlags<KeyboardModifier>,
    type_: Type
) -> CppBox<QDragMoveEvent>
[src]

Creates a QDragMoveEvent of the required type indicating that the mouse is at position pos given within a widget.

Calls C++ function: [constructor] void QDragMoveEvent::QDragMoveEvent(const QPoint& pos, QFlags<Qt::DropAction> actions, const QMimeData* data, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, QEvent::Type type = …).

C++ documentation:

Creates a QDragMoveEvent of the required type indicating that the mouse is at position pos given within a widget.

The mouse and keyboard states are specified by buttons and modifiers, and the actions describe the types of drag and drop operation that are possible. The drag data is passed as MIME-encoded information in data.

Warning: Do not attempt to create a QDragMoveEvent yourself. These objects rely on Qt's internal state.

pub unsafe fn new_5a(
    pos: impl CastInto<Ref<QPoint>>,
    actions: QFlags<DropAction>,
    data: impl CastInto<Ptr<QMimeData>>,
    buttons: QFlags<MouseButton>,
    modifiers: QFlags<KeyboardModifier>
) -> CppBox<QDragMoveEvent>
[src]

Creates a QDragMoveEvent of the required type indicating that the mouse is at position pos given within a widget.

Calls C++ function: [constructor] void QDragMoveEvent::QDragMoveEvent(const QPoint& pos, QFlags<Qt::DropAction> actions, const QMimeData* data, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers).

C++ documentation:

Creates a QDragMoveEvent of the required type indicating that the mouse is at position pos given within a widget.

The mouse and keyboard states are specified by buttons and modifiers, and the actions describe the types of drag and drop operation that are possible. The drag data is passed as MIME-encoded information in data.

Warning: Do not attempt to create a QDragMoveEvent yourself. These objects rely on Qt's internal state.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QDragMoveEvent>>
) -> CppBox<QDragMoveEvent>
[src]

The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress.

Calls C++ function: [constructor] void QDragMoveEvent::QDragMoveEvent(const QDragMoveEvent& other).

C++ documentation:

The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress.

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.

Methods from Deref<Target = QDropEvent>

pub unsafe fn accept_proposed_action(&self)[src]

Sets the drop action to be the proposed action.

Calls C++ function: void QDropEvent::acceptProposedAction().

C++ documentation:

Sets the drop action to be the proposed action.

See also setDropAction(), proposedAction(), and accept().

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QDropEvent>>
) -> Ref<QDropEvent>
[src]

The QDropEvent class provides an event which is sent when a drag and drop action is completed.

Calls C++ function: QDropEvent& QDropEvent::operator=(const QDropEvent& other).

C++ documentation:

The QDropEvent class provides an event which is sent when a drag and drop action is completed.

When a widget accepts drop events, it will receive this event if it has accepted the most recent QDragEnterEvent or QDragMoveEvent sent to it.

The drop event contains a proposed action, available from proposedAction(), for the widget to either accept or ignore. If the action can be handled by the widget, you should call the acceptProposedAction() function. Since the proposed action can be a combination of Qt::DropAction values, it may be useful to either select one of these values as a default action or ask the user to select their preferred action.

If the proposed drop action is not suitable, perhaps because your custom widget does not support that action, you can replace it with any of the possible drop actions by calling setDropAction() with your preferred action. If you set a value that is not present in the bitwise OR combination of values returned by possibleActions(), the default copy action will be used. Once a replacement drop action has been set, call accept() instead of acceptProposedAction() to complete the drop operation.

The mimeData() function provides the data dropped on the widget in a QMimeData object. This contains information about the MIME type of the data in addition to the data itself.

pub unsafe fn drop_action(&self) -> DropAction[src]

Returns the action to be performed on the data by the target. This may be different from the action supplied in proposedAction() if you have called setDropAction() to explicitly choose a drop action.

Calls C++ function: Qt::DropAction QDropEvent::dropAction() const.

C++ documentation:

Returns the action to be performed on the data by the target. This may be different from the action supplied in proposedAction() if you have called setDropAction() to explicitly choose a drop action.

See also setDropAction().

pub unsafe fn keyboard_modifiers(&self) -> QFlags<KeyboardModifier>[src]

Returns the modifier keys that are pressed.

Calls C++ function: QFlags<Qt::KeyboardModifier> QDropEvent::keyboardModifiers() const.

C++ documentation:

Returns the modifier keys that are pressed.

pub unsafe fn mime_data(&self) -> QPtr<QMimeData>[src]

Returns the data that was dropped on the widget and its associated MIME type information.

Calls C++ function: const QMimeData* QDropEvent::mimeData() const.

C++ documentation:

Returns the data that was dropped on the widget and its associated MIME type information.

pub unsafe fn mouse_buttons(&self) -> QFlags<MouseButton>[src]

Returns the mouse buttons that are pressed..

Calls C++ function: QFlags<Qt::MouseButton> QDropEvent::mouseButtons() const.

C++ documentation:

Returns the mouse buttons that are pressed..

pub unsafe fn pos(&self) -> CppBox<QPoint>[src]

Returns the position where the drop was made.

Calls C++ function: QPoint QDropEvent::pos() const.

C++ documentation:

Returns the position where the drop was made.

pub unsafe fn pos_f(&self) -> Ref<QPointF>[src]

Returns the position where the drop was made.

Calls C++ function: const QPointF& QDropEvent::posF() const.

C++ documentation:

Returns the position where the drop was made.

pub unsafe fn possible_actions(&self) -> QFlags<DropAction>[src]

Returns an OR-combination of possible drop actions.

Calls C++ function: QFlags<Qt::DropAction> QDropEvent::possibleActions() const.

C++ documentation:

Returns an OR-combination of possible drop actions.

See also dropAction().

pub unsafe fn proposed_action(&self) -> DropAction[src]

Returns the proposed drop action.

Calls C++ function: Qt::DropAction QDropEvent::proposedAction() const.

C++ documentation:

Returns the proposed drop action.

See also dropAction().

pub unsafe fn set_drop_action(&self, action: DropAction)[src]

Sets the action to be performed on the data by the target. Use this to override the proposed action with one of the possible actions.

Calls C++ function: void QDropEvent::setDropAction(Qt::DropAction action).

C++ documentation:

Sets the action to be performed on the data by the target. Use this to override the proposed action with one of the possible actions.

If you set a drop action that is not one of the possible actions, the drag and drop operation will default to a copy operation.

Once you have supplied a replacement drop action, call accept() instead of acceptProposedAction().

See also dropAction().

pub unsafe fn source(&self) -> QPtr<QObject>[src]

If the source of the drag operation is a widget in this application, this function returns that source; otherwise it returns 0. The source of the operation is the first parameter to the QDrag object used instantiate the drag.

Calls C++ function: QObject* QDropEvent::source() const.

C++ documentation:

If the source of the drag operation is a widget in this application, this function returns that source; otherwise it returns 0. The source of the operation is the first parameter to the QDrag object used instantiate the drag.

This is useful if your widget needs special behavior when dragging to itself.

See also QDrag::QDrag().

Trait Implementations

impl CppDeletable for QDragMoveEvent[src]

unsafe fn delete(&self)[src]

Destroys the event.

Calls C++ function: virtual [destructor] void QDragMoveEvent::~QDragMoveEvent().

C++ documentation:

Destroys the event.

impl Deref for QDragMoveEvent[src]

type Target = QDropEvent

The resulting type after dereferencing.

fn deref(&self) -> &QDropEvent[src]

Calls C++ function: QDropEvent* static_cast<QDropEvent*>(QDragMoveEvent* ptr).

impl DynamicCast<QDragEnterEvent> for QDragMoveEvent[src]

unsafe fn dynamic_cast(ptr: Ptr<QDragMoveEvent>) -> Ptr<QDragEnterEvent>[src]

Calls C++ function: QDragEnterEvent* dynamic_cast<QDragEnterEvent*>(QDragMoveEvent* ptr).

impl DynamicCast<QDragMoveEvent> for QDropEvent[src]

unsafe fn dynamic_cast(ptr: Ptr<QDropEvent>) -> Ptr<QDragMoveEvent>[src]

Calls C++ function: QDragMoveEvent* dynamic_cast<QDragMoveEvent*>(QDropEvent* ptr).

impl DynamicCast<QDragMoveEvent> for QEvent[src]

unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QDragMoveEvent>[src]

Calls C++ function: QDragMoveEvent* dynamic_cast<QDragMoveEvent*>(QEvent* ptr).

impl StaticDowncast<QDragEnterEvent> for QDragMoveEvent[src]

unsafe fn static_downcast(ptr: Ptr<QDragMoveEvent>) -> Ptr<QDragEnterEvent>[src]

Calls C++ function: QDragEnterEvent* static_cast<QDragEnterEvent*>(QDragMoveEvent* ptr).

impl StaticDowncast<QDragMoveEvent> for QDropEvent[src]

unsafe fn static_downcast(ptr: Ptr<QDropEvent>) -> Ptr<QDragMoveEvent>[src]

Calls C++ function: QDragMoveEvent* static_cast<QDragMoveEvent*>(QDropEvent* ptr).

impl StaticDowncast<QDragMoveEvent> for QEvent[src]

unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QDragMoveEvent>[src]

Calls C++ function: QDragMoveEvent* static_cast<QDragMoveEvent*>(QEvent* ptr).

impl StaticUpcast<QDragMoveEvent> for QDragEnterEvent[src]

unsafe fn static_upcast(ptr: Ptr<QDragEnterEvent>) -> Ptr<QDragMoveEvent>[src]

Calls C++ function: QDragMoveEvent* static_cast<QDragMoveEvent*>(QDragEnterEvent* ptr).

impl StaticUpcast<QDropEvent> for QDragMoveEvent[src]

unsafe fn static_upcast(ptr: Ptr<QDragMoveEvent>) -> Ptr<QDropEvent>[src]

Calls C++ function: QDropEvent* static_cast<QDropEvent*>(QDragMoveEvent* ptr).

impl StaticUpcast<QEvent> for QDragMoveEvent[src]

unsafe fn static_upcast(ptr: Ptr<QDragMoveEvent>) -> Ptr<QEvent>[src]

Calls C++ function: QEvent* static_cast<QEvent*>(QDragMoveEvent* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.