Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QColorDrag Class Reference

The QColorDrag class provides a drag and drop object for transferring colors between widgets. More...

    #include <QColorDrag>

Inherits QStoredDrag.

- List of all members, including inherited members
- Obsolete members

### Writable Properties

- 1 writable property inherited from QObject

### Public Functions

- QColorDrag ( const QColor & col, QWidget * dragsource = 0 )
- QColorDrag ( QWidget * dragsource = 0 )
- void setColor ( const QColor & color )

- 2 public functions inherited from QStoredDrag
- 9 public functions inherited from QDragObject
- 24 public functions inherited from QObject
- 4 public functions inherited from QMimeSource

### Public Slots

- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- bool canDecode ( QMimeSource * source )
- bool decode ( QMimeSource * source, QColor & color )

- 1 static public member inherited from QDragObject
- 4 static public members inherited from QObject

### Protected Functions

- 1 protected function inherited from QDragObject
- 9 protected functions inherited from QObject

## Detailed Description

The QColorDrag class provides a drag and drop object for transferring colors between widgets.

This class provides a drag object which can be used to transfer data about colors for drag and drop and in the clipboard. For example, it is used in QColorDialog.

The color is set in the constructor but can be changed with setColor().

For more information about drag and drop, see the QDragObject class and the drag and drop documentation.

## Member Function Documentation

### QColorDrag::QColorDrag ( const QColor & col, QWidget * dragsource = 0 )

Constructs a color drag object with the given col and dragsource. The dragsource is passed to the QStoredDrag constructor.

### QColorDrag::QColorDrag ( QWidget * dragsource = 0 )

Constructs a color drag object with a white color. Passes dragsource to the QStoredDrag constructor.

### bool QColorDrag::canDecode ( QMimeSource * source ) `[static]`

Returns true if the color drag object can decode the MIME source; otherwise returns false.

### bool QColorDrag::decode ( QMimeSource * source, QColor & color ) `[static]`

Decodes the MIME source, and sets the decoded values to the given color.

### void QColorDrag::setColor ( const QColor & color )

Sets the color of the color drag.