QMimeSource Class Reference

[ QtGui module]

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

Inherited by QDropEvent .

方法


详细描述

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 。见 Drag and Drop 了解细节。


方法文档编制

QMimeSource.__init__ ( self )

QMimeSource.__init__ ( self , QMimeSource )

QByteArray QMimeSource.encodedData ( self , str)

This method is abstract and should be reimplemented in any sub-class.

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

str QMimeSource.format ( self , int  i  = 0)

This method is abstract and should be reimplemented in any sub-class.

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

bool QMimeSource.provides ( self , str)

Returns true if the object can provide the data in format mimeType ;否则返回 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().