class openalea.oalab.plugin.oalab.mimedata.IQMimeCodec(**kargs)[source]

Bases: openalea.oalab.plugin.oalab.mimedata.IQMimeEncoder, openalea.oalab.plugin.oalab.mimedata.IQMimeDecoder

class openalea.oalab.plugin.oalab.mimedata.IQMimeCodecPlugin(**kargs)[source]

Bases: openalea.core.interface.IInterface

An encoder should define: 1 TYPE -> n out mimetype

qtdecode(mimedata, mimetype_in, mimetype_out)[source]
implement = 'IQMimeCodec'
class openalea.oalab.plugin.oalab.mimedata.IQMimeDecoder(**kargs)[source]

Bases: openalea.core.interface.IInterface

Convert a QMimeData to a python object

A decoder should define: 1 TYPE -> n out mimetype

qtdecode(mimedata, mimetype_in, mimetype_out)[source]
quick_check(mimedata, mimetype_in, mimetype_out)[source]

Proceed to a quick check: return True if mimedata can be decoded to mimetype_out else return False

For example, a Decoder "text/uri-list -> openalea/interface.IImage" can create an array by reading path content if path is an image file. But if path is not image, user do not want to see it. In this case, quick_check can just check file extension, if extension is a valid image extension (.jpg, .png, ...) quick_check return True, else False

class openalea.oalab.plugin.oalab.mimedata.IQMimeEncoder(**kargs)[source]

Bases: openalea.core.interface.IInterface

Convert a python object to a QMimeData

qtencode(data, qmimedata, mimetype_in, mimetype_out)[source]
Parameters:
  • data -- Data (python object) you want to encode
  • qmimedata -- QtCore.QMimeData to populate. Can be not empty. This qmimedata is generated from DragManager. Trust it.

Previous topic

Control - Advanced

Next topic

<no title>

This Page