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.
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.
Constructs a default image drag object with the given name 。 dragSource is the widget that the drag operation started from.
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.