Ejemplo n.º 1
0
def dropEvent(event, format="application/x-job-names"):
    if event.mimeData().hasFormat(format):
        item = event.mimeData().data(format)
        stream = QtCore.QDataStream(item, QtCore.QIODevice.ReadOnly)
        names = QtCore.QString()
        stream >> names
        event.accept()
        return [name for name in str(names).split(":") if name]
Ejemplo n.º 2
0
def mimeDataAdd(mimeData, format, objects):
    data = QtCore.QByteArray()
    stream = QtCore.QDataStream(data, QtCore.QIODevice.WriteOnly)
    text = QtCore.QString(":".join(objects))
    stream << text
    mimeData.setData(format, data)