Eneboo - Documentación para desarrolladores
Métodos públicos | Métodos públicos estáticos | Amigas
Referencia de la Clase QIconDrag

The QIconDrag class supports drag and drop operations within a QIconView. Más...

#include <qiconview.h>

Diagrama de herencias de QIconDrag
QDragObject QDragObject QMimeSource QObject QMimeSource QObject QMimeSource QObject QMimeSource QObject

Lista de todos los miembros.

Métodos públicos

 QIconDrag (QWidget *dragSource, const char *name=0)
virtual ~QIconDrag ()
void append (const QIconDragItem &item, const QRect &pr, const QRect &tr)
virtual const char * format (int i) const
virtual QByteArray encodedData (const char *mime) const
 QIconDrag (QWidget *dragSource, const char *name=0)
virtual ~QIconDrag ()
void append (const QIconDragItem &item, const QRect &pr, const QRect &tr)
virtual const char * format (int i) const
virtual QByteArray encodedData (const char *mime) const

Métodos públicos estáticos

static bool canDecode (QMimeSource *e)
static bool canDecode (QMimeSource *e)

Amigas

class QIconView
class QIconViewPrivate

Descripción detallada

The QIconDrag class supports drag and drop operations within a QIconView.

iconview

A QIconDrag object is used to maintain information about the positions of dragged items and the data associated with the dragged items. QIconViews are able to use this information to paint the dragged items in the correct positions. Internally QIconDrag stores the data associated with drag items in QIconDragItem objects.

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

The data in QIconDragItems is stored in a QByteArray and is mime-typed (see QMimeSource and the Drag and Drop overview). If you want to use your own mime-types derive a class from QIconDrag and reimplement format(), encodedData() and canDecode().

The fileiconview example program demonstrates the use of the QIconDrag class including subclassing and reimplementing dragObject(), format(), encodedData() and canDecode(). See the files qt/examples/fileiconview/qfileiconview.h and qt/examples/fileiconview/qfileiconview.cpp.

Ver también:
QMimeSource::format()

Documentación del constructor y destructor

QIconDrag::QIconDrag ( QWidget dragSource,
const char *  name = 0 
)

Constructs a drag object called name, which is a child of dragSource.

Note that the drag object will be deleted when dragSource is deleted.

QIconDrag::~QIconDrag ( ) [virtual]

Destructor.

QIconDrag::QIconDrag ( QWidget dragSource,
const char *  name = 0 
)
virtual QIconDrag::~QIconDrag ( ) [virtual]

Documentación de las funciones miembro

void QIconDrag::append ( const QIconDragItem i,
const QRect pr,
const QRect tr 
)

Append the QIconDragItem, i, to the QIconDrag object's list of items. You must also supply the geometry of the pixmap, pr, and the textual caption, tr.

Ver también:
QIconDragItem
void QIconDrag::append ( const QIconDragItem item,
const QRect pr,
const QRect tr 
)
static bool QIconDrag::canDecode ( QMimeSource e) [static]
bool QIconDrag::canDecode ( QMimeSource e) [static]

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

QByteArray QIconDrag::encodedData ( const char *  mime) const [virtual]

Returns the encoded data of the drag object if mime is application/x-qiconlist.

Implementa QMimeSource.

virtual QByteArray QIconDrag::encodedData ( const char *  ) const [virtual]

Returns the encoded data of this object in the specified MIME format.

Subclasses must reimplement this function.

Implementa QMimeSource.

virtual const char* QIconDrag::format ( int  i) const [virtual]

Returns the {i}-th supported MIME format, or 0.

Implementa QMimeSource.

const char * QIconDrag::format ( int  i) const [virtual]

Implementa QMimeSource.


Documentación de las funciones relacionadas y clases amigas

QIconView [friend]
QIconViewPrivate [friend]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'