tags:

views:

293

answers:

1

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 );
+1  A: 

There are only a few (mime) types that work well with every application/OS combination (e.g. Text and Bitmap)

EDIT: Which really means: To decide if this is a general issue or something to do with your code, you have to provide more info.

AndreasT