Qt Toolkit - QDropEvent Class

# QDropEvent Class Reference

Event sent when a drag-and-drop is completed. More...

`#include <qevent.h>`

Inherits QEvent.

List of all member functions.

## Public Members

- QDropEvent ( const QPoint & pos )
- const QPoint& pos () const
- bool isAccepted () const
- void accept ()
- void ignore ()
- QByteArray data ( const char * )

## Detailed Description

Event sent when a drag-and-drop is completed.

When a widgets accepts drop events, it will receive this event if it has accepted the most recent QDragEnterEvent or QDragMoveEvent sent to it.

The widget should use data() to extract data in an appropriate format.

## Member Function Documentation

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

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

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

### void QDropEvent::accept ()

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

### QByteArray QDropEvent::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.

The resulting data will have a size of 0 if the format was not available.

See also: QDragMoveEvent::data() and QDragMoveEvent::format().

### void QDropEvent::ignore ()

The opposite of accept().

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