PyMimeData

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

Bases: PyQt5.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(self, str, Union[QByteArray, bytes, …)

Attributes Documentation

MIME_TYPE = 'application/py_instance'

Methods Documentation

data(mime_type)

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()
hasFormat(fmt)
setData(self, str, Union[QByteArray, bytes, bytearray])