QIconDrag(3qt)

NAME
QIconDrag - The drag object which is used for moving items in the iconview

#include <qiconview.h>

Inherits QDragObject.

  Public Members
virtual ~QIconDrag ()
void append ( const QIconDragItem & item, const QRect & pr, const QRect & tr )
virtual QByteArray encodedData ( const char * mime ) const

  Static Public Members
bool canDecode ( QMimeSource * e )

DESCRIPTION
The QIconDrag class is the drag object which is used for moving items in the iconview

The QIconDrag is the drag object which is used for moving items in the iconview. The QIconDrag stores exact informations about the positions of the items, which are dragged, so that each iconview is able to draw drag shapes in correct positions. Also the data of each dragged item is stored here.

If you want to use extended DnD functionality of the QIconView, normally it's enough to just create a QIconDrag object in QIconView::dragObject(). Then create for each item which should be dragged a QIconDragItem and set the data it represents with QIconDragItem::setData() and add this item to the drag object using append().

If you want to offer the data in other mime-types too, derive a class from this and implement the needed encoding and decoding here.

An example, how to implement this, is in the QtFileIconView example (qt/examples/qfileiconview/qfileiconview.h and qt/examples/qfileiconview/qfileiconview.cpp).

MEMBER FUNCTION DOCUMENTATION

QIconDrag::QIconDrag ( QWidget * dragSource, const char * name = 0 )
Reimplemented for internal reasons; the API is not affected.

QIconDrag::~QIconDrag () [virtual]
Destructor.

void QIconDrag::append ( const QIconDragItem & i, const QRect & pr, const QRect & tr )
Appends an icon drag item which should be stored in this dragobject and the geometry of it.

See also QIconDragItem.

bool QIconDrag::canDecode ( QMimeSource * e ) [static]
Returns TRUE if e can be decoded by the QIconDrag, else FALSE.

QByteArray QIconDrag::encodedData ( const char * mime ) const [virtual]
Returns the encoded data of the drag object if mime is application/x-qiconlist.

const char* QIconDrag::format ( int i ) const [virtual]
Reimplemented for internal reasons; the API is not affected.

SEE ALSO
http://doc.trolltech.com/qicondrag.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qicondrag.3) and the Qt version (2.3.0).