PyMimeData

class glue.utils.qt.PyMimeData(instance=None, **kwargs)[source]

Bases: PyQt4.QtCore.QMimeData

A custom MimeData object that stores live python objects

Associate specific objects with a mime type by passing mime type / object kev/value pairs to the __init__ method

If a single object is passed to the init method, that object is associated with the PyMimeData.MIME_TYPE mime type

Parameters:instance – The python object to store

kwargs: Optional mime type / objects pairs to store as objects

Attributes Summary

MIME_TYPE

Methods Summary

data(mime_type) Retrieve the data stored at the specified mime_type
formats()
hasFormat(fmt)
setData(mime, data)

Attributes Documentation

MIME_TYPE = 'application/py_instance'

Methods Documentation

data(mime_type)[source]

Retrieve the data stored at the specified mime_type

If mime_type is application/py_instance, a python object is returned. Otherwise, a QtCore.QByteArray is returned

formats()[source]
hasFormat(fmt)[source]
setData(mime, data)[source]