|  | Home · All Classes · Main Classes · Annotated · Grouped Classes · Functions |

# QDragMoveEvent Class Reference

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

    #include <QDragMoveEvent>

Part of the QtGui module.

Inherits QDropEvent.

Inherited by QDragEnterEvent.

- List of all members, including inherited members
- Qt 3 support members

### Public Functions

- QDragMoveEvent ( const QPoint & pos, Qt::DropActions actions, const QMimeData * data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove )
- ~QDragMoveEvent ()
- void accept ()
- void accept ( const QRect & rectangle )
- QRect answerRect () const
- void ignore ( const QRect & rectangle )
- void ignore ()

- 11 public functions inherited from QDropEvent
- 6 public functions inherited from QEvent

### Additional Inherited Members

- 1 property inherited from QEvent

## Detailed Description

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

When a widget accepts drop events, it will receive this event repeatedly while the drag is within the widget's boundaries. 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.

## Member Function Documentation

### QDragMoveEvent::QDragMoveEvent ( const QPoint & pos, Qt::DropActions actions, const QMimeData * data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove )

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

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

### QDragMoveEvent::~QDragMoveEvent ()

Destroys the event.

### void QDragMoveEvent::accept ()

### void QDragMoveEvent::accept ( const QRect & rectangle )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

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, then drag move events will be sent continuously. This is useful if the source is scrolling in a timer event.

### QRect QDragMoveEvent::answerRect () const

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.

### void QDragMoveEvent::ignore ( const QRect & rectangle )

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

### void QDragMoveEvent::ignore ()

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Calls QDropEvent::ignore().