Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Atributos protegidos
Referencia de la Clase QDropEvent

The QDropEvent class provides an event which is sent when a drag and drop is completed. Más...

#include <qevent.h>

Diagrama de herencias de QDropEvent
QEvent QMimeSource QEvent QMimeSource Qt Qt Qt Qt QDragMoveEvent QDragMoveEvent QDragEnterEvent QDragEnterEvent QDragEnterEvent QDragEnterEvent

Lista de todos los miembros.

Tipos públicos

enum  Action {
  Copy, Link, Move, Private,
  UserAction = 100, Copy, Link, Move,
  Private, UserAction = 100
}
enum  Action {
  Copy, Link, Move, Private,
  UserAction = 100, Copy, Link, Move,
  Private, UserAction = 100
}

Métodos públicos

 QDropEvent (const QPoint &pos, Type typ=Drop)
const QPointpos () const
bool isAccepted () const
void accept (bool y=TRUE)
void ignore ()
bool isActionAccepted () const
void acceptAction (bool y=TRUE)
void setAction (Action a)
Action action () const
QWidgetsource () const
const char * format (int n=0) const
QByteArray encodedData (const char *) const
bool provides (const char *) const
QByteArray data (const char *f) const
void setPoint (const QPoint &np)
 QDropEvent (const QPoint &pos, Type typ=Drop)
const QPointpos () const
bool isAccepted () const
void accept (bool y=TRUE)
void ignore ()
bool isActionAccepted () const
void acceptAction (bool y=TRUE)
void setAction (Action a)
Action action () const
QWidgetsource () const
const char * format (int n=0) const
QByteArray encodedData (const char *) const
bool provides (const char *) const
QByteArray data (const char *f) const
void setPoint (const QPoint &np)

Atributos protegidos

QPoint p
uint act:8
uint accpt:1
uint accptact:1
uint resv:5
void * d

Descripción detallada

The QDropEvent class provides an event which is sent when a drag and drop is completed.

When a widget 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 the data in an appropriate format.


Documentación de las enumeraciones miembro de la clase

This enum describes the action which a source requests that a target perform with dropped data.

Copy The default action. The source simply uses the data provided in the operation. Link The source should somehow create a link to the location specified by the data. Move The source should somehow move the object from the location specified by the data to a new location. Private The target has special knowledge of the MIME type, which the source should respond to in a similar way to a Copy. UserAction The source and target can co-operate using special actions. This feature is not currently supported.

The Link and Move actions only makes sense if the data is a reference, for example, text/uri-list file lists (see QUriDrag).

Valores de enumeraciones:
Copy 
Link 
Move 
Private 
UserAction 
Copy 
Link 
Move 
Private 
UserAction 
Valores de enumeraciones:
Copy 
Link 
Move 
Private 
UserAction 
Copy 
Link 
Move 
Private 
UserAction 

Documentación del constructor y destructor

QDropEvent::QDropEvent ( const QPoint pos,
Type  typ = Drop 
) [inline]

Constructs a drop event that drops a drop of type typ on point pos.

QDropEvent::QDropEvent ( const QPoint pos,
Type  typ = Drop 
) [inline]

Documentación de las funciones miembro

void QDropEvent::accept ( bool  y = TRUE) [inline]

Call this function to indicate whether the event provided data which your widget processed. Set y to TRUE (the default) if your widget could process the data, otherwise set y to FALSE. To get the data, use encodedData(), or preferably, the decode() methods of existing QDragObject subclasses, such as QTextDrag::decode(), or your own subclasses.

Ver también:
acceptAction()

Reimplementado en QDragMoveEvent y QDragMoveEvent.

void QDropEvent::accept ( bool  y = TRUE) [inline]

Reimplementado en QDragMoveEvent y QDragMoveEvent.

void QDropEvent::acceptAction ( bool  y = TRUE) [inline]
void QDropEvent::acceptAction ( bool  y = TRUE) [inline]

Call this to indicate that the action described by action() is accepted (i.e. if y is TRUE, which is the default), not merely the default copy action. If you call acceptAction(TRUE), there is no need to also call accept(TRUE).

Action QDropEvent::action ( ) const [inline]

Returns the Action which the target is requesting to be performed with the data. If your application understands the action and can process the supplied data, call acceptAction(); if your application can process the supplied data but can only perform the Copy action, call accept().

Action QDropEvent::action ( ) const [inline]
QByteArray QDropEvent::data ( const char *  f) const [inline]
QByteArray QDropEvent::data ( const char *  f) const [inline]
QByteArray QDropEvent::encodedData ( const char *  format) const [virtual]

Returns a byte array containing the drag's data, 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.

Ver también:
format() QByteArray::size()

Implementa QMimeSource.

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

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

Subclasses must reimplement this function.

Implementa QMimeSource.

const char* QDropEvent::format ( int  i = 0) const [virtual]

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

Implementa QMimeSource.

const char * QDropEvent::format ( int  n = 0) const [virtual]

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().

Ver también:
data() provides()

Implementa QMimeSource.

void QDropEvent::ignore ( ) [inline]

The opposite of accept(), i.e. you have ignored the drop event.

Reimplementado en QDragMoveEvent y QDragMoveEvent.

void QDropEvent::ignore ( ) [inline]

Reimplementado en QDragMoveEvent y QDragMoveEvent.

bool QDropEvent::isAccepted ( ) const [inline]
bool QDropEvent::isAccepted ( ) const [inline]

Returns TRUE if the drop target accepts the event; otherwise returns FALSE.

bool QDropEvent::isActionAccepted ( ) const [inline]
bool QDropEvent::isActionAccepted ( ) const [inline]

Returns TRUE if the drop action was accepted by the drop site; otherwise returns FALSE.

const QPoint & QDropEvent::pos ( ) const [inline]

Returns the position where the drop was made.

const QPoint& QDropEvent::pos ( ) const [inline]
bool QDropEvent::provides ( const char *  mimeType) const [virtual]

Returns TRUE if the object can provide the data in format mimeType; otherwise returns FALSE.

If you inherit from QMimeSource, for consistency reasons it is better to implement the more abstract canDecode() functions such as QTextDrag::canDecode() and QImageDrag::canDecode().

Reimplementado de QMimeSource.

bool QDropEvent::provides ( const char *  mimeType) const [virtual]

Returns TRUE if this event provides format mimeType; otherwise returns FALSE.

Ver también:
data()

Reimplementado de QMimeSource.

void QDropEvent::setAction ( Action  a) [inline]

Sets the action to a. This is used internally, you should not need to call this in your code: the source decides the action, not the target.

void QDropEvent::setAction ( Action  a) [inline]
void QDropEvent::setPoint ( const QPoint np) [inline]
void QDropEvent::setPoint ( const QPoint np) [inline]

Sets the drop to happen at point np. You do not normally need to use this as it will be set internally before your widget receives the drop event.

QWidget* QDropEvent::source ( ) const
QWidget* QDropEvent::source ( ) const

Documentación de los datos miembro

uint QDropEvent::accpt [protected]
uint QDropEvent::act [protected]
void * QDropEvent::d [protected]
QPoint QDropEvent::p [protected]
uint QDropEvent::resv [protected]

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'