Qt logo

QIconDrag Class Reference


The QIconDrag is the drag object which is used for moving items in the iconview More...

#include <qiconview.h>

Inherits QDragObject.

List of all member functions.

Public Members

Static Public Members


Detailed Description

The QIconDrag 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.

It's suggested that, if you write a drag object for own QIconViewItems, you derive the drag object class from QIconDrag and just (re)implement the methods which are needed for encoding/decoding your data and the mimetype handling. Because if you do this, the position information will be stored in the drag object too.

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 ( const QIconList & icons_, QWidget * dragSource, const char * name = 0 )

Constructs a icon dragobject which contains a list of icons (list of QIconDragItems). dragSource is the widget which started the dragand name the name of the object.

See also: QIconDragItem.

QIconDrag::~QIconDrag () [virtual]

Destructor.

void QIconDrag::append ( const QIconDragItem & icon_ )

Appends an icon drag item which should be stored in this dragobject.

See also: QIconDragItem.

bool QIconDrag::canDecode ( QMimeSource * e ) [static]

Returns TRUE if e can be decoded by the QIconDrag, else FALSE.

bool QIconDrag::decode ( QMimeSource * e, QIconList & list_ ) [static]

Decodes the data which is stored (endocded) in e and if successful, fills the list of icon drag items with the decoded data.

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.

void QIconDrag::setIcons ( const QIconList & list_ )

Sets the list of icon drag items which should be stored in this dragobject.

See also: QIconDragItem.


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


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


Copyright © 2000 Troll TechTrademarks
Qt version 2.1.0 (pre-release)