From e1743eb396dcaa593b26a6c39b30179ea9dc04d9 Mon Sep 17 00:00:00 2001 From: kriegerj Date: Wed, 26 Aug 2015 16:11:41 +0200 Subject: [PATCH] bugfix: copy to clipboard as image now works better on Windows (before it was not that easy to paste into PowerPoint!) --- jkqtpbaseplotter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jkqtpbaseplotter.cpp b/jkqtpbaseplotter.cpp index 3eb60be59c..420e6f35d8 100644 --- a/jkqtpbaseplotter.cpp +++ b/jkqtpbaseplotter.cpp @@ -3056,8 +3056,14 @@ void JKQtBasePlotter::copyPixelImage() { //qDebug()<<"clipboard before adding content:\n"<mimeData()->formats(); //clipboard->setImage(png); clipboard->clear(); + clipboard->setPixmap(QPixmap::fromImage(png)); QMimeData* mime=new QMimeData(); - mime->setImageData(png); + mime->setImageData(QPixmap::fromImage(png)); + QBuffer pngbuf; + png.save(&pngbuf, "png"); + mime->setData("image/x-png", pngbuf.data()); + png.save(&pngbuf, "bmp"); + mime->setData("image/bmp", pngbuf.data()); mime->setData("image/svg+xml", svgdata); clipboard->setMimeData(mime); //qDebug()<<"clipboard after adding content:\n"<mimeData()->formats();