# Namespace KColorMimeData

Module | kdeui
Namespace | KColorMimeData

Drag-and-drop and clipboard mimedata manipulation for QColor objects. The according MIME type is set to application/x-color.

See the Qt drag'n'drop documentation.

### methods

- canDecode (mimeData)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  mimeData | QMimeData |

  Returns true if the MIME data mimeData contains a color object. First checks for application/x-color and if that fails, for a text/plain entry, which represents a color in the format \#hexnumbers

- createDrag (color, dragsource)

  returns QDrag

  Argument | Type | Default
  --- | --- | ---
  color | QColor |
  dragsource | QWidget |

  Creates a color drag object. Either you have to start this drag or delete it The drag object's mime data has the application/x-color and text/plain type set and a pixmap filled with the specified color, which is going to be displayed next to the mouse cursor

- fromMimeData (mimeData)

  returns QColor

  Argument | Type | Default
  --- | --- | ---
  mimeData | QMimeData |

  Decodes the MIME data mimeData and returns the resulting color. First tries application/x-color and if that fails, a text/plain entry, which represents a color in the format \#hexnumbers. If this fails too, an invalid QColor object is returned, use QColor.isValid() to test it.

- populateMimeData (mimeData, color)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  mimeData | QMimeData |
  color | QColor |

  Sets the color and text representation fields for the specified color in the mimedata object: application/x-color and text/plain types are set