[][src]Struct qt_widgets::QGraphicsSceneDragDropEvent

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

The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.

C++ class: QGraphicsSceneDragDropEvent.

C++ documentation:

The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.

QGraphicsView inherits the drag and drop functionality provided by QWidget. When it receives a drag and drop event, it translates it to a QGraphicsSceneDragDropEvent.

QGraphicsSceneDragDropEvent stores events of type GraphicsSceneDragEnter, GraphicsSceneDragLeave, GraphicsSceneDragMove, or GraphicsSceneDrop.

QGraphicsSceneDragDropEvent contains the position of the mouse cursor in both item, scene, and screen coordinates; this can be retrieved with pos(), scenePos(), and screenPos().

The scene sends the event to the first QGraphicsItem under the mouse cursor that accepts drops; a graphics item is set to accept drops with setAcceptDrops().

Methods

impl QGraphicsSceneDragDropEvent[src]

pub unsafe fn accept_proposed_action(&mut self)[src]

Sets the proposed action as accepted, i.e, the drop action is set to the proposed action. This is equal to:

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

C++ documentation:

Sets the proposed action as accepted, i.e, the drop action is set to the proposed action. This is equal to:


  setDropAction(proposedAction());

When using this function, one should not call accept().

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

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

Returns a Qt::MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.

Calls C++ function: QFlags<Qt::MouseButton> QGraphicsSceneDragDropEvent::buttons() const.

C++ documentation:

Returns a Qt::MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.

See also Qt::MouseButtons.

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

Returns the action that was performed in this drag and drop. This should be set by the receiver of the drop and is returned by QDrag::exec().

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

C++ documentation:

Returns the action that was performed in this drag and drop. This should be set by the receiver of the drop and is returned by QDrag::exec().

See also setDropAction() and acceptProposedAction().

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

This function returns the MIME data of the event.

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

C++ documentation:

This function returns the MIME data of the event.

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

Returns the keyboard modifiers that were pressed when the drag and drop event was created.

Calls C++ function: QFlags<Qt::KeyboardModifier> QGraphicsSceneDragDropEvent::modifiers() const.

C++ documentation:

Returns the keyboard modifiers that were pressed when the drag and drop event was created.

See also Qt::KeyboardModifiers.

pub unsafe fn new_1a(type_: Type) -> CppBox<QGraphicsSceneDragDropEvent>[src]

Calls C++ function: [constructor] void QGraphicsSceneDragDropEvent::QGraphicsSceneDragDropEvent(QEvent::Type type = …).

pub unsafe fn new_0a() -> CppBox<QGraphicsSceneDragDropEvent>[src]

The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.

Calls C++ function: [constructor] void QGraphicsSceneDragDropEvent::QGraphicsSceneDragDropEvent().

C++ documentation:

The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.

QGraphicsView inherits the drag and drop functionality provided by QWidget. When it receives a drag and drop event, it translates it to a QGraphicsSceneDragDropEvent.

QGraphicsSceneDragDropEvent stores events of type GraphicsSceneDragEnter, GraphicsSceneDragLeave, GraphicsSceneDragMove, or GraphicsSceneDrop.

QGraphicsSceneDragDropEvent contains the position of the mouse cursor in both item, scene, and screen coordinates; this can be retrieved with pos(), scenePos(), and screenPos().

The scene sends the event to the first QGraphicsItem under the mouse cursor that accepts drops; a graphics item is set to accept drops with setAcceptDrops().

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

Returns the mouse position of the event relative to the view that sent the event.

Calls C++ function: QPointF QGraphicsSceneDragDropEvent::pos() const.

C++ documentation:

Returns the mouse position of the event relative to the view that sent the event.

See also QGraphicsView, screenPos(), and scenePos().

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

Returns the possible drop actions that the drag and drop can result in.

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

C++ documentation:

Returns the possible drop actions that the drag and drop can result in.

See also Qt::DropActions.

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

Returns the drop action that is proposed, i.e., preferred. The action must be one of the possible actions as defined by possibleActions().

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

C++ documentation:

Returns the drop action that is proposed, i.e., preferred. The action must be one of the possible actions as defined by possibleActions().

See also Qt::DropAction and possibleActions().

pub unsafe fn scene_pos(&self) -> CppBox<QPointF>[src]

Returns the position of the mouse in scene coordinates.

Calls C++ function: QPointF QGraphicsSceneDragDropEvent::scenePos() const.

C++ documentation:

Returns the position of the mouse in scene coordinates.

See also pos() and screenPos().

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

Returns the position of the mouse relative to the screen.

Calls C++ function: QPoint QGraphicsSceneDragDropEvent::screenPos() const.

C++ documentation:

Returns the position of the mouse relative to the screen.

See also pos() and scenePos().

pub unsafe fn set_buttons(&mut self, buttons: QFlags<MouseButton>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setButtons(QFlags<Qt::MouseButton> buttons).

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

This function lets the receiver of the drop set the drop action that was performed to action, which should be one of the possible actions. Call accept() in stead of acceptProposedAction() if you use this function.

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

C++ documentation:

This function lets the receiver of the drop set the drop action that was performed to action, which should be one of the possible actions. Call accept() in stead of acceptProposedAction() if you use this function.

See also dropAction(), accept(), and possibleActions().

pub unsafe fn set_mime_data(&mut self, data: impl CastInto<Ptr<QMimeData>>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setMimeData(const QMimeData* data).

pub unsafe fn set_modifiers(&mut self, modifiers: QFlags<KeyboardModifier>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setModifiers(QFlags<Qt::KeyboardModifier> modifiers).

pub unsafe fn set_pos(&mut self, pos: impl CastInto<Ref<QPointF>>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setPos(const QPointF& pos).

pub unsafe fn set_possible_actions(&mut self, actions: QFlags<DropAction>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setPossibleActions(QFlags<Qt::DropAction> actions).

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

Calls C++ function: void QGraphicsSceneDragDropEvent::setProposedAction(Qt::DropAction action).

pub unsafe fn set_scene_pos(&mut self, pos: impl CastInto<Ref<QPointF>>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setScenePos(const QPointF& pos).

pub unsafe fn set_screen_pos(&mut self, pos: impl CastInto<Ref<QPoint>>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setScreenPos(const QPoint& pos).

pub unsafe fn set_source(&mut self, source: impl CastInto<MutPtr<QWidget>>)[src]

Calls C++ function: void QGraphicsSceneDragDropEvent::setSource(QWidget* source).

pub unsafe fn source(&self) -> MutPtr<QWidget>[src]

This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.

Calls C++ function: QWidget* QGraphicsSceneDragDropEvent::source() const.

C++ documentation:

This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.

Methods from Deref<Target = QGraphicsSceneEvent>

pub unsafe fn set_widget(&mut self, widget: impl CastInto<MutPtr<QWidget>>)[src]

Calls C++ function: void QGraphicsSceneEvent::setWidget(QWidget* widget).

pub unsafe fn widget(&self) -> MutPtr<QWidget>[src]

Returns the widget where the event originated, or 0 if the event originates from another application.

Calls C++ function: QWidget* QGraphicsSceneEvent::widget() const.

C++ documentation:

Returns the widget where the event originated, or 0 if the event originates from another application.

Trait Implementations

impl CppDeletable for QGraphicsSceneDragDropEvent[src]

unsafe fn delete(&mut self)[src]

Destroys the object.

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

C++ documentation:

Destroys the object.

impl Deref for QGraphicsSceneDragDropEvent[src]

type Target = QGraphicsSceneEvent

The resulting type after dereferencing.

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

Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneDragDropEvent* ptr).

impl DerefMut for QGraphicsSceneDragDropEvent[src]

fn deref_mut(&mut self) -> &mut QGraphicsSceneEvent[src]

Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneDragDropEvent* ptr).

impl DynamicCast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneDragDropEvent>
[src]

Calls C++ function: QGraphicsSceneDragDropEvent* dynamic_cast<QGraphicsSceneDragDropEvent*>(QGraphicsSceneEvent* ptr).

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneDragDropEvent>
[src]

Calls C++ function: QGraphicsSceneDragDropEvent* dynamic_cast<QGraphicsSceneDragDropEvent*>(QGraphicsSceneEvent* ptr).

impl DynamicCast<QGraphicsSceneDragDropEvent> for QEvent[src]

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

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QEvent>
) -> MutPtr<QGraphicsSceneDragDropEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneDragDropEvent>
[src]

Calls C++ function: QGraphicsSceneDragDropEvent* static_cast<QGraphicsSceneDragDropEvent*>(QGraphicsSceneEvent* ptr).

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneDragDropEvent>
[src]

Calls C++ function: QGraphicsSceneDragDropEvent* static_cast<QGraphicsSceneDragDropEvent*>(QGraphicsSceneEvent* ptr).

impl StaticDowncast<QGraphicsSceneDragDropEvent> for QEvent[src]

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

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QEvent>
) -> MutPtr<QGraphicsSceneDragDropEvent>
[src]

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

impl StaticUpcast<QEvent> for QGraphicsSceneDragDropEvent[src]

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

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneDragDropEvent>
) -> MutPtr<QEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneDragDropEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneDragDropEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneDragDropEvent* ptr).

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneDragDropEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneDragDropEvent* 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.