Q3ColorDrag Class

The Q3ColorDrag class provides a drag and drop object for transferring colors between widgets. 更多...

头: #include <Q3ColorDrag>
继承: Q3StoredDrag

公共函数

Q3ColorDrag (const QColor & col , QWidget * dragsource = 0, const char * name = 0)
Q3ColorDrag (QWidget * dragsource = 0, const char * name = 0)
void setColor (const QColor & color )

静态公共成员

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

额外继承成员

详细描述

The Q3ColorDrag 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 Q3DragObject 类和 drag and drop documentation .

成员函数文档编制

Q3ColorDrag:: Q3ColorDrag (const QColor & col , QWidget * dragsource = 0, const char * name = 0)

Constructs a color drag object with the given col . Passes dragsource and name Q3StoredDrag 构造函数。

Q3ColorDrag:: Q3ColorDrag ( QWidget * dragsource = 0, const char * name = 0)

Constructs a color drag object with a white color. Passes dragsource and name Q3StoredDrag 构造函数。

[static] bool Q3ColorDrag:: canDecode ( QMimeSource * source )

Returns true if the color drag object can decode the MIME source ;否则返回 false。

[static] bool Q3ColorDrag:: decode ( QMimeSource * source , QColor & color )

Decodes the MIME source , and sets the decoded values to the given color . Returns true if the decoding is successful. Returns false if the size of the encoded data is not the expected size.

void Q3ColorDrag:: setColor (const QColor & color )

设置 color of the color drag.