I would like to write a simple Qt app (in Python with PySide6) that will generate a midi file such that the user can drag it directly into their DAW (e.g. Reaper, Ableton, Bitwig).
I have got
def mousePressEvent(self,e):
if e.button() == Qt.LeftButton:
drag = QDrag(self)
mimeData = QMimeData()
mimeData.setData("audio/midi",mid)
drag.setMimeData(mimeData)
drag.exec(Qt.CopyAction)
in my mousePressEvent
, and this seems to get halfway there: Reaper reacts as if a MIDI file is being dragged over. But what do I do next so that the MIDI arrives in Reaper when I release the drag?