Q3ImageDrag Class

The Q3ImageDrag class provides a drag and drop object for transferring images. 更多...

头: #include <Q3ImageDrag>
继承: Q3DragObject

公共函数

Q3ImageDrag (QImage image , QWidget * dragSource = 0, const char * name = 0)
Q3ImageDrag (QWidget * dragSource = 0, const char * name = 0)
~Q3ImageDrag ()
virtual void setImage (QImage image )

重实现公共函数

virtual QByteArray encodedData (const char * fmt ) const
virtual const char * format (int i ) const

静态公共成员

bool canDecode (const QMimeSource * source )
bool decode (const QMimeSource * source , QImage & image )
bool decode (const QMimeSource * source , QPixmap & pixmap )

额外继承成员

详细描述

The Q3ImageDrag class provides a drag and drop object for transferring images.

Images are offered to the receiving application in multiple formats, determined by Qt's output formats.

成员函数文档编制

Q3ImageDrag:: Q3ImageDrag ( QImage image , QWidget * dragSource = 0, const char * name = 0)

Constructs an image drag object with the given name , and sets its data to image dragSource is the widget that the drag operation started from.

Q3ImageDrag:: Q3ImageDrag ( QWidget * dragSource = 0, const char * name = 0)

Constructs a default image drag object with the given name dragSource is the widget that the drag operation started from.

Q3ImageDrag:: ~Q3ImageDrag ()

Destroys the image drag object.

[static] bool Q3ImageDrag:: canDecode (const QMimeSource * source )

Returns true if the information in the MIME source can be decoded into an image; otherwise returns false.

另请参阅 decode ().

[static] bool Q3ImageDrag:: decode (const QMimeSource * source , QImage & image )

Decode the dropped information in the MIME source image . Returns true if successful; otherwise returns false.

另请参阅 canDecode ().

[static] bool Q3ImageDrag:: decode (const QMimeSource * source , QPixmap & pixmap )

这是重载函数。

Decodes the dropped information in the MIME source pixmap . Returns true if successful; otherwise returns false.

This is a convenience function that converts the information to a QPixmap via a QImage .

另请参阅 canDecode ().

[虚拟] QByteArray Q3ImageDrag:: encodedData (const char * fmt ) const

重实现自 QMimeSource::encodedData ().

[虚拟] const char * Q3ImageDrag:: format ( int i ) const

重实现自 QMimeSource::format ().

[虚拟] void Q3ImageDrag:: setImage ( QImage image )

设置 image to be dragged. You will need to call this if you did not pass the image during construction.