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

The QDragObject class encapsulates MIME-based data transfer. Más...

#include <qdragobject.h>

Diagrama de herencias de QDragObject
QObject QMimeSource QObject QMimeSource Qt Qt Qt Qt QIconDrag QIconDrag QImageDrag QImageDrag QStoredDrag QStoredDrag QTextDrag QTextDrag

Lista de todos los miembros.

Tipos públicos

enum  DragMode {
  DragDefault, DragCopy, DragMove, DragLink,
  DragCopyOrMove, DragDefault, DragCopy, DragMove,
  DragLink, DragCopyOrMove
}
enum  DragMode {
  DragDefault, DragCopy, DragMove, DragLink,
  DragCopyOrMove, DragDefault, DragCopy, DragMove,
  DragLink, DragCopyOrMove
}

Métodos públicos

 QDragObject (QWidget *dragSource=0, const char *name=0)
virtual ~QDragObject ()
bool drag ()
bool dragMove ()
void dragCopy ()
void dragLink ()
virtual void setPixmap (QPixmap)
virtual void setPixmap (QPixmap, const QPoint &hotspot)
QPixmap pixmap () const
QPoint pixmapHotSpot () const
QWidgetsource ()
 QDragObject (QWidget *dragSource=0, const char *name=0)
virtual ~QDragObject ()
bool drag ()
bool dragMove ()
void dragCopy ()
void dragLink ()
virtual void setPixmap (QPixmap)
virtual void setPixmap (QPixmap, const QPoint &hotspot)
QPixmap pixmap () const
QPoint pixmapHotSpot () const
QWidgetsource ()

Métodos públicos estáticos

static QWidgettarget ()
static void setTarget (QWidget *)
static QWidgettarget ()
static void setTarget (QWidget *)

Métodos protegidos

virtual bool drag (DragMode)
virtual bool drag (DragMode)

Descripción detallada

The QDragObject class encapsulates MIME-based data transfer.

QDragObject is the base class for all data that needs to be transferred between and within applications, both for drag and drop and for the clipboard.

See the Drag-and-drop documentation for an overview of how to provide drag and drop in your application.

See the QClipboard documentation for an overview of how to provide cut-and-paste in your application.

The drag() function is used to start a drag operation. You can specify the DragMode in the call or use one of the convenience functions dragCopy(), dragMove() or dragLink(). The drag source where the data originated is retrieved with source(). If the data was dropped on a widget within the application, target() will return a pointer to that widget. Specify the pixmap to display during the drag with setPixmap().


Documentación de las enumeraciones miembro de la clase

This enum describes the possible drag modes.

DragDefault The mode is determined heuristically. DragCopy The data is copied, never moved. DragMove The data is moved, if dragged at all. DragLink The data is linked, if dragged at all. DragCopyOrMove The user chooses the mode by using a control key to switch from the default.

Valores de enumeraciones:
DragDefault 
DragCopy 
DragMove 
DragLink 
DragCopyOrMove 
DragDefault 
DragCopy 
DragMove 
DragLink 
DragCopyOrMove 
Valores de enumeraciones:
DragDefault 
DragCopy 
DragMove 
DragLink 
DragCopyOrMove 
DragDefault 
DragCopy 
DragMove 
DragLink 
DragCopyOrMove 

Documentación del constructor y destructor

QDragObject::QDragObject ( QWidget dragSource = 0,
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.

QDragObject::~QDragObject ( ) [virtual]

Destroys the drag object, canceling any drag and drop operation in which it is involved, and frees up the storage used.

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

Documentación de las funciones miembro

bool QDragObject::drag ( )

Starts a drag operation using the contents of this object, using DragDefault mode.

The function returns TRUE if the caller should delete the original copy of the dragged data (but see target()); otherwise returns FALSE.

If the drag contains references to information (e.g. file names in a QUriDrag are references) then the return value should always be ignored, as the target is expected to manipulate the referred-to content directly. On X11 the return value should always be correct anyway, but on Windows this is not necessarily the case (e.g. the file manager starts a background process to move files, so the source {must not} delete the files!)

Note that on Windows the drag operation will spin a blocking modal event loop that will not dispatch any QTimers.

bool QDragObject::drag ( DragMode  mode) [protected, virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Starts a drag operation using the contents of this object.

At this point, the object becomes owned by Qt, not the application. You should not delete the drag object or anything it references. The actual transfer of data to the target application will be done during future event processing - after that time the drag object will be deleted.

Returns TRUE if the dragged data was dragged as a move, indicating that the caller should remove the original source of the data (the drag object must continue to have a copy); otherwise returns FALSE.

The mode specifies the drag mode (see {QDragObject::DragMode}.) Normally one of the simpler drag(), dragMove(), or dragCopy() functions would be used instead.

bool QDragObject::drag ( )
virtual bool QDragObject::drag ( DragMode  ) [protected, virtual]
void QDragObject::dragCopy ( )

Starts a drag operation using the contents of this object, using DragCopy mode. Be sure to read the constraints described in drag().

Ver también:
drag() dragMove() dragLink()
void QDragObject::dragCopy ( )
void QDragObject::dragLink ( )

Starts a drag operation using the contents of this object, using DragLink mode. Be sure to read the constraints described in drag().

Ver también:
drag() dragCopy() dragMove()
void QDragObject::dragLink ( )
bool QDragObject::dragMove ( )

Starts a drag operation using the contents of this object, using DragMove mode. Be sure to read the constraints described in drag().

Ver también:
drag() dragCopy() dragLink()
bool QDragObject::dragMove ( )
QPixmap QDragObject::pixmap ( ) const
QPixmap QDragObject::pixmap ( ) const

Returns the currently set pixmap (which isNull() if none is set).

QPoint QDragObject::pixmapHotSpot ( ) const

Returns the currently set pixmap hotspot.

QPoint QDragObject::pixmapHotSpot ( ) const
virtual void QDragObject::setPixmap ( QPixmap  ) [virtual]
void QDragObject::setPixmap ( QPixmap  pm) [virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Uses a hotspot that positions the pixmap below and to the right of the mouse pointer. This allows the user to clearly see the point on the window which they are dragging the data onto.

void QDragObject::setPixmap ( QPixmap  pm,
const QPoint hotspot 
) [virtual]

Set the pixmap pm to display while dragging the object. The platform-specific implementation will use this where it can - so provide a small masked pixmap, and do not assume that the user will actually see it. For example, cursors on Windows 95 are of limited size.

The hotspot is the point on (or off) the pixmap that should be under the cursor as it is dragged. It is relative to the top-left pixel of the pixmap.

Atención:
We have seen problems with drag cursors on different graphics hardware and driver software on Windows. Setting the graphics acceleration in the display settings down one tick solved the problems in all cases.
virtual void QDragObject::setPixmap ( QPixmap  ,
const QPoint hotspot 
) [virtual]
void QDragObject::setTarget ( QWidget t) [static]
static void QDragObject::setTarget ( QWidget ) [static]
QWidget * QDragObject::source ( )

Returns a pointer to the drag source where this object originated.

QWidget* QDragObject::source ( )
static QWidget* QDragObject::target ( ) [static]
QWidget * QDragObject::target ( ) [static]

After the drag completes, this function will return the QWidget which received the drop, or 0 if the data was dropped on another application.

This can be useful for detecting the case where drag and drop is to and from the same widget.


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'