TCO drag: Fix Ctrl+Drag crash

Fix some assumptions that source and target of a drag actions are the same
track container. Instead of looking up necessary information (track name,
type and container id) by track index, add it to the metadata.
Refactor canPasteSelection to take QDropEvent instead of the drop event's
QMimeData. Coincidentally, this fixes the method to be consistent with its
documentation.

Fixes #4844
This commit is contained in:
Lukas W
2019-03-01 09:00:46 +01:00
parent dd6c18e62b
commit e1adfc3952
2 changed files with 19 additions and 10 deletions

View File

@@ -341,7 +341,7 @@ public:
}
}
bool canPasteSelection( MidiTime tcoPos, const QMimeData * mimeData );
bool canPasteSelection( MidiTime tcoPos, const QDropEvent *de );
bool pasteSelection( MidiTime tcoPos, QDropEvent * de );
MidiTime endPosition( const MidiTime & posStart );