mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-24 17:41:39 +08:00
bugfix: copy to clipboard as image now works better on Windows (before it was not that easy to paste into PowerPoint!)
This commit is contained in:
parent
34631fb66f
commit
e1743eb396
@ -3056,8 +3056,14 @@ void JKQtBasePlotter::copyPixelImage() {
|
||||
//qDebug()<<"clipboard before adding content:\n"<<clipboard->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"<<clipboard->mimeData()->formats();
|
||||
|
Loading…
Reference in New Issue
Block a user