Skip to content

Don't convert QByteArray in `startDrag`

Fushan Wen requested to merge (removed):cherry-pick-22de23c4 into kde/5.15

QMimeData::setData expects the provided data to contain the correctly encoded QByteArray, so if the variant contains a QByteArray, then take it as is to avoid data loss.

If the variant is not already a byte array, then we ideally would make sure that the mime type (i.e. the key of the map) and the QVariant's type are compatible (image/png with a QImage works; text/plain with a QImage does not). This changes behavior and needs to be a follow-up commit.

Fixes: QTBUG-71922 Change-Id: I9b9f10fd332e1f9568f6835a69a1c359457f823c Reviewed-by: Volker Hilsheimer (cherry picked from commit 062f9bf5) Reviewed-by: Qt Cherry-pick Bot

(cherry picked from commit 22de23c4)

Required to port custom drag handlers

Merge request reports