QMimeSource Class

The QMimeSource class is an abstraction of objects that provided formatted data of a certain MIME type. More...

Header: #include <QMimeSource>
Inherited By:

Q3DragObject and QDropEvent

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Public Functions

virtual ~QMimeSource()
virtual QByteArray encodedData(const char * format) const = 0
virtual const char * format(int i = 0) const = 0
virtual bool provides(const char * mimeType) const

Detailed Description

The QMimeSource class is an abstraction of objects that provided formatted data of a certain MIME type.

The preferred approach to drag and drop is to use QDrag in conjunction with QMimeData. See Drag and Drop for details.

See also QMimeData and QDrag.

Member Function Documentation

[virtual] QMimeSource::~QMimeSource()

Destroys the MIME source.

[pure virtual] QByteArray QMimeSource::encodedData(const char * format) const

Returns the encoded data of this object in the specified MIME format.

[pure virtual] const char * QMimeSource::format(int i = 0) const

Returns the (i - 1)-th supported MIME format, or 0.

[virtual] bool QMimeSource::provides(const char * mimeType) const

Returns true if the object can provide the data in format mimeType; otherwise returns false.

If you inherit from QMimeSource, for consistency reasons it is better to implement the more abstract canDecode() functions such as QTextDrag::canDecode() and QImageDrag::canDecode().

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