Q3ImageDrag Class

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

Header: #include <Q3ImageDrag>
Inherits: Q3DragObject

Public Functions

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

Reimplemented Public Functions

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

Static Public Members

bool canDecode(const QMimeSource * source)
bool decode(const QMimeSource * source, QImage & image)
bool decode(const QMimeSource * source, QPixmap & pixmap)
  • 1 static public member inherited from Q3DragObject
  • 7 static public members inherited from QObject

Additional Inherited Members

Detailed Description

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.

Member Function Documentation

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. The 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. The 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.

See also decode().

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

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

See also canDecode().

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

This is an overloaded function.

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

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

See also canDecode().

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

Reimplemented from QMimeSource::encodedData().

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

Reimplemented from QMimeSource::format().

[virtual] void Q3ImageDrag::setImage(QImage image)

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

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.