# QDragMoveEvent Class Reference

Event sent as a drag-and-drop is in progress. More...

`#include <qevent.h>`

Inherits QEvent.

Inherited by QDragEnterEvent.

List of all member functions.

## Public Members

- QDragMoveEvent ( const QPoint & pos )
- const QPoint& pos () const
- bool isAccepted () const
- void accept ()
- void ignore ()
- void accept ( const QRect & r )
- void ignore ( const QRect & r )
- QRect answerRect () const
- const char* format ( int n = 0 )
- bool provides ( const char * )
- QByteArray data ( const char * )

## Protected Members

- QDragMoveEvent ( const QPoint & pos, int type )

## Detailed Description

Event sent as a drag-and-drop is in progress.

When a widgets accepts drop events, it will receive this event repeatedly while the the drag is inside that widget. The widget should examine the event, especially seeing what data it provides, and accept() the drop if appropriate.

## Member Function Documentation

### QDragMoveEvent::QDragMoveEvent ( const QPoint & pos )

Creates a QDragMoveEvent for which the mouse is at point pos.

Note that internal state is also involved with QDragMoveEvent, so it is not useful to create these yourself.

### QDragMoveEvent::QDragMoveEvent ( const QPoint & pos, int type ) `[protected]`

Creates a QDragMoveEvent for which the mouse is at point pos, and the given event type.

Note that internal state is also involved with QDragMoveEvent, so it is not useful to create these yourself.

### void QDragMoveEvent::accept ()

Call this to indicate that the event provides data which your widget can process. Use provides(), or preferrably, the canDecode() methods of existing QDragObject subclasses, such as QTextDrag::canDecode(), or your own subclasses.

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

The same as accept() above, but also notifies that future moves will also be acceptable if they remain withing the rectangle r on the widget - this can improve performance, but may also be ignored by the underlying system.

### QRect QDragMoveEvent::answerRect () const

{ return rect; }

Returns the rectangle for which the acceptance of the move event applies.

### QByteArray QDragMoveEvent::data ( const char * format )

Returns a byte array containing the payload data of this drag, in format.

data() normally needs to get the data from the drag source, which is potentially very slow, so it's advisable to call this function only if you're sure that you will need the data in format.

See also: format().

### const char * QDragMoveEvent::format ( int n = 0 )

Returns a string describing one of the available data types for this drag. Common examples are "text/plain" and "image/gif". If n is less than zero or greater than the number of available data types, format() returns 0.

This function is provided mainly for debugging. Most drop targets will use provides().

See also: data() and provides().

### void QDragMoveEvent::ignore ()

The opposite of accept().

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

The opposite of accept(const QRect&).

### bool QDragMoveEvent::isAccepted () const

Returns TRUE if accept() has been called.

### const QPoint& QDragMoveEvent::pos () const

Returns the position of the mouse when the event occurred.

### bool QDragMoveEvent::provides ( const char * mimeType )

Returns TRUE if this drag object provides format mimeType or FALSE if it does not.

See also: data().

Search the documentation, FAQ, qt-interest archive and more (uses www.troll.no):

This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.

It was generated from the following files:

- qevent.h: 1998/10/05
- qdnd_x11.cpp: 1998/12/17
- qevent.cpp: 1999/01/13