Qt Reference Documentation

QMimeSource Class Reference

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

 #include <QMimeSource>

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

Inherited by Q3DragObject and QDropEvent.

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

QMimeSource::~QMimeSource () [virtual]

Destroys the MIME source.

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

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

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

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

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

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().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.