PySide6.QtGui.QDragMoveEvent¶
- class QDragMoveEvent¶
The
QDragMoveEventclass provides an event which is sent while a drag and drop action is in progress.Details
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
datait provides, and call theaccept()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 callacceptProposedAction()if that is the case.Note that this class inherits most of its functionality from
QDropEvent.See also
Inherited by:
QDragEnterEventSynopsis¶
Methods¶
def
__init__()def
__repr__()def
accept()def
answerRect()def
ignore()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__(arg__1)¶
- Parameters:
arg__1 –
QDragMoveEvent
- __init__(pos, actions, data, buttons, modifiers[, type=QEvent.Type.DragMove])
- Parameters:
pos –
QPointactions – Combination of
DropActiondata –
QMimeDatabuttons – Combination of
MouseButtonmodifiers – Combination of
KeyboardModifiertype –
Type
Creates a
QDragMoveEventof the requiredtypeindicating that the mouse is at positionposgiven within a widget.The mouse and keyboard states are specified by
buttonsandmodifiers, and theactionsdescribe the types of drag and drop operation that are possible. The drag data is passed as MIME-encoded information indata.Warning
Do not attempt to create a
QDragMoveEventyourself. These objects rely on Qt’s internal state.- __repr__()¶
- Return type:
str
- accept()¶
Calls QDropEvent::accept().
- accept(r)
- Parameters:
r –
QRect
The same as
accept(), but also notifies that future moves will also be acceptable if they remain within therectanglegiven 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.
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.
- ignore()¶
Calls QDropEvent::ignore().
- ignore(r)
- Parameters:
r –
QRect
The opposite of the accept(const QRect&) function. Moves within the
rectangleare not acceptable, and will be ignored.