I have a QImage that I would like to put on the clipboard, which I can do just fine. However the transparency is lost when that data is pasted into a non-Qt application. The transparent part just comes out as black. I tried saving the data as a transparent PNG but nothing is usable on the clipboard.
This is what I have so far:
QImage mergedImage = mergeSelectedItems(scene->items());
QMimeData* mimeData = new QMimeData();
QByteArray data;
QBuffer buffer(&data);
buffer.open(QIODevice::WriteOnly);
mergedImage.save(&buffer, "PNG");
buffer.close();
mimeData->setData("image/png", data);
clipboard->setMimeData( mimeData );