#[repr(C)]pub struct QGraphicsSceneDragDropEvent { /* private fields */ }
Expand description
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.
C++ class: QGraphicsSceneDragDropEvent
.
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().
Implementations§
Source§impl QGraphicsSceneDragDropEvent
impl QGraphicsSceneDragDropEvent
Sourcepub unsafe fn accept_proposed_action(&self)
pub unsafe fn accept_proposed_action(&self)
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()
.
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().
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
.
Returns a Qt::MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.
See also Qt::MouseButtons.
Sourcepub unsafe fn drop_action(&self) -> DropAction
pub unsafe fn drop_action(&self) -> DropAction
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
.
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().
Sourcepub unsafe fn mime_data(&self) -> QPtr<QMimeData>
pub unsafe fn mime_data(&self) -> QPtr<QMimeData>
This function returns the MIME data of the event.
Calls C++ function: const QMimeData* QGraphicsSceneDragDropEvent::mimeData() const
.
This function returns the MIME data of the event.
Sourcepub unsafe fn modifiers(&self) -> QFlags<KeyboardModifier>
pub unsafe fn modifiers(&self) -> QFlags<KeyboardModifier>
Returns the keyboard modifiers that were pressed when the drag and drop event was created.
Calls C++ function: QFlags<Qt::KeyboardModifier> QGraphicsSceneDragDropEvent::modifiers() const
.
Returns the keyboard modifiers that were pressed when the drag and drop event was created.
See also Qt::KeyboardModifiers.
Sourcepub unsafe fn new_1a(type_: Type) -> CppBox<QGraphicsSceneDragDropEvent>
pub unsafe fn new_1a(type_: Type) -> CppBox<QGraphicsSceneDragDropEvent>
Calls C++ function: [constructor] void QGraphicsSceneDragDropEvent::QGraphicsSceneDragDropEvent(QEvent::Type type = …)
.
Sourcepub unsafe fn new_0a() -> CppBox<QGraphicsSceneDragDropEvent>
pub unsafe fn new_0a() -> CppBox<QGraphicsSceneDragDropEvent>
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.
Calls C++ function: [constructor] void QGraphicsSceneDragDropEvent::QGraphicsSceneDragDropEvent()
.
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().
Sourcepub unsafe fn pos(&self) -> CppBox<QPointF>
pub unsafe fn pos(&self) -> CppBox<QPointF>
Returns the mouse position of the event relative to the view that sent the event.
Calls C++ function: QPointF QGraphicsSceneDragDropEvent::pos() const
.
Returns the mouse position of the event relative to the view that sent the event.
See also QGraphicsView, screenPos(), and scenePos().
Sourcepub unsafe fn possible_actions(&self) -> QFlags<DropAction>
pub unsafe fn possible_actions(&self) -> QFlags<DropAction>
Returns the possible drop actions that the drag and drop can result in.
Calls C++ function: QFlags<Qt::DropAction> QGraphicsSceneDragDropEvent::possibleActions() const
.
Returns the possible drop actions that the drag and drop can result in.
See also Qt::DropActions.
Sourcepub unsafe fn proposed_action(&self) -> DropAction
pub unsafe fn proposed_action(&self) -> DropAction
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
.
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().
Sourcepub unsafe fn scene_pos(&self) -> CppBox<QPointF>
pub unsafe fn scene_pos(&self) -> CppBox<QPointF>
Returns the position of the mouse in scene coordinates.
Calls C++ function: QPointF QGraphicsSceneDragDropEvent::scenePos() const
.
Sourcepub unsafe fn screen_pos(&self) -> CppBox<QPoint>
pub unsafe fn screen_pos(&self) -> CppBox<QPoint>
Returns the position of the mouse relative to the screen.
Calls C++ function: QPoint QGraphicsSceneDragDropEvent::screenPos() const
.
Calls C++ function: void QGraphicsSceneDragDropEvent::setButtons(QFlags<Qt::MouseButton> buttons)
.
Sourcepub unsafe fn set_drop_action(&self, action: DropAction)
pub unsafe fn set_drop_action(&self, action: DropAction)
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)
.
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().
Sourcepub unsafe fn set_mime_data(&self, data: impl CastInto<Ptr<QMimeData>>)
pub unsafe fn set_mime_data(&self, data: impl CastInto<Ptr<QMimeData>>)
Calls C++ function: void QGraphicsSceneDragDropEvent::setMimeData(const QMimeData* data)
.
Sourcepub unsafe fn set_modifiers(&self, modifiers: QFlags<KeyboardModifier>)
pub unsafe fn set_modifiers(&self, modifiers: QFlags<KeyboardModifier>)
Calls C++ function: void QGraphicsSceneDragDropEvent::setModifiers(QFlags<Qt::KeyboardModifier> modifiers)
.
Sourcepub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QGraphicsSceneDragDropEvent::setPos(const QPointF& pos)
.
Sourcepub unsafe fn set_possible_actions(&self, actions: QFlags<DropAction>)
pub unsafe fn set_possible_actions(&self, actions: QFlags<DropAction>)
Calls C++ function: void QGraphicsSceneDragDropEvent::setPossibleActions(QFlags<Qt::DropAction> actions)
.
Sourcepub unsafe fn set_proposed_action(&self, action: DropAction)
pub unsafe fn set_proposed_action(&self, action: DropAction)
Calls C++ function: void QGraphicsSceneDragDropEvent::setProposedAction(Qt::DropAction action)
.
Sourcepub unsafe fn set_scene_pos(&self, pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_scene_pos(&self, pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QGraphicsSceneDragDropEvent::setScenePos(const QPointF& pos)
.
Sourcepub unsafe fn set_screen_pos(&self, pos: impl CastInto<Ref<QPoint>>)
pub unsafe fn set_screen_pos(&self, pos: impl CastInto<Ref<QPoint>>)
Calls C++ function: void QGraphicsSceneDragDropEvent::setScreenPos(const QPoint& pos)
.
Sourcepub unsafe fn set_source(&self, source: impl CastInto<Ptr<QWidget>>)
pub unsafe fn set_source(&self, source: impl CastInto<Ptr<QWidget>>)
Calls C++ function: void QGraphicsSceneDragDropEvent::setSource(QWidget* source)
.
Sourcepub unsafe fn source(&self) -> QPtr<QWidget>
pub unsafe fn source(&self) -> QPtr<QWidget>
This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.
Calls C++ function: QWidget* QGraphicsSceneDragDropEvent::source() const
.
This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.
Methods from Deref<Target = QGraphicsSceneEvent>§
Sourcepub unsafe fn set_widget(&self, widget: impl CastInto<Ptr<QWidget>>)
pub unsafe fn set_widget(&self, widget: impl CastInto<Ptr<QWidget>>)
Calls C++ function: void QGraphicsSceneEvent::setWidget(QWidget* widget)
.
Sourcepub unsafe fn widget(&self) -> QPtr<QWidget>
pub unsafe fn widget(&self) -> QPtr<QWidget>
Returns the widget where the event originated, or 0 if the event originates from another application.
Calls C++ function: QWidget* QGraphicsSceneEvent::widget() const
.
Returns the widget where the event originated, or 0 if the event originates from another application.
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 QGraphicsSceneDragDropEvent
impl CppDeletable for QGraphicsSceneDragDropEvent
Source§impl Deref for QGraphicsSceneDragDropEvent
impl Deref for QGraphicsSceneDragDropEvent
Source§fn deref(&self) -> &QGraphicsSceneEvent
fn deref(&self) -> &QGraphicsSceneEvent
Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneDragDropEvent* ptr)
.
Source§type Target = QGraphicsSceneEvent
type Target = QGraphicsSceneEvent
Source§impl DynamicCast<QGraphicsSceneDragDropEvent> for QEvent
impl DynamicCast<QGraphicsSceneDragDropEvent> for QEvent
Source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneDragDropEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneDragDropEvent>
Calls C++ function: QGraphicsSceneDragDropEvent* dynamic_cast<QGraphicsSceneDragDropEvent*>(QEvent* ptr)
.
Source§impl DynamicCast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent
impl DynamicCast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent
Source§unsafe fn dynamic_cast(
ptr: Ptr<QGraphicsSceneEvent>,
) -> Ptr<QGraphicsSceneDragDropEvent>
unsafe fn dynamic_cast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneDragDropEvent>
Calls C++ function: QGraphicsSceneDragDropEvent* dynamic_cast<QGraphicsSceneDragDropEvent*>(QGraphicsSceneEvent* ptr)
.
Source§impl StaticDowncast<QGraphicsSceneDragDropEvent> for QEvent
impl StaticDowncast<QGraphicsSceneDragDropEvent> for QEvent
Source§unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneDragDropEvent>
unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneDragDropEvent>
Calls C++ function: QGraphicsSceneDragDropEvent* static_cast<QGraphicsSceneDragDropEvent*>(QEvent* ptr)
.
Source§impl StaticDowncast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent
impl StaticDowncast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent
Source§unsafe fn static_downcast(
ptr: Ptr<QGraphicsSceneEvent>,
) -> Ptr<QGraphicsSceneDragDropEvent>
unsafe fn static_downcast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneDragDropEvent>
Calls C++ function: QGraphicsSceneDragDropEvent* static_cast<QGraphicsSceneDragDropEvent*>(QGraphicsSceneEvent* ptr)
.
Source§impl StaticUpcast<QEvent> for QGraphicsSceneDragDropEvent
impl StaticUpcast<QEvent> for QGraphicsSceneDragDropEvent
Source§unsafe fn static_upcast(ptr: Ptr<QGraphicsSceneDragDropEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QGraphicsSceneDragDropEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QGraphicsSceneDragDropEvent* ptr)
.
Source§impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneDragDropEvent
impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneDragDropEvent
Source§unsafe fn static_upcast(
ptr: Ptr<QGraphicsSceneDragDropEvent>,
) -> Ptr<QGraphicsSceneEvent>
unsafe fn static_upcast( ptr: Ptr<QGraphicsSceneDragDropEvent>, ) -> Ptr<QGraphicsSceneEvent>
Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneDragDropEvent* ptr)
.