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.