kdeui Library API Documentation

KColorDrag Class Reference

A drag-and-drop object for colors. More...

#include <kcolordrag.h>

Inheritance diagram for KColorDrag:

QStoredDrag List of all members.

Public Methods

 KColorDrag (QWidget *dragsource=0, const char *name=0)
 Constructs a color drag with a white color.

 KColorDrag (const QColor &col, QWidget *dragsource=0, const char *name=0)
 Constructs a color drag with the color @p.

void setColor (const QColor &col)
 Sets the color of the drag to col.


Static Public Methods

bool canDecode (QMimeSource *e)
 Returns true if the MIME source e contains a color object.

bool decode (QMimeSource *e, QColor &col)
 Decodes the MIME source e and puts the resulting color into col.

KColorDrag * makeDrag (const QColor &, QWidget *dragsource)

Detailed Description

A drag-and-drop object for colors.

The according MIME type is set to application/x-color.

See the Qt drag'n'drop documentation.

Definition at line 35 of file kcolordrag.h.


Constructor & Destructor Documentation

KColorDrag::KColorDrag QWidget   dragsource = 0,
const char *    name = 0
 

Constructs a color drag with a white color.

Definition at line 68 of file kcolordrag.cpp.

References setColor().

Referenced by makeDrag().

KColorDrag::KColorDrag const QColor   col,
QWidget   dragsource = 0,
const char *    name = 0
 

Constructs a color drag with the color @p.

Definition at line 61 of file kcolordrag.cpp.

References setColor().


Member Function Documentation

void KColorDrag::setColor const QColor   col
 

Sets the color of the drag to col.

Definition at line 75 of file kcolordrag.cpp.

References QColor::blue(), QPainter::drawRect(), QPainter::end(), QPixmap::fill(), QColor::green(), QColor::red(), QStoredDrag::setEncodedData(), and QPainter::setPen().

Referenced by KColorDrag().

bool KColorDrag::canDecode QMimeSource   e [static]
 

Returns true if the MIME source e contains a color object.

Definition at line 98 of file kcolordrag.cpp.

References QMimeSource::provides().

bool KColorDrag::decode QMimeSource   e,
QColor   col
[static]
 

Decodes the MIME source e and puts the resulting color into col.

Definition at line 104 of file kcolordrag.cpp.

References QMimeSource::encodedData(), and QColor::setRgb().

KColorDrag * KColorDrag::makeDrag const QColor  ,
QWidget   dragsource
[static]
 

Deprecated:
This is equivalent with "new KColorDrag(color, dragsource)".

Definition at line 116 of file kcolordrag.cpp.

References KColorDrag().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:03 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001