[Qt-interest] Windows: Copy from Qt app into GIMP fails?

Jason H scorp1us at yahoo.com
Tue Feb 15 18:25:43 CET 2011


I've only done limited clipboarding, but I'd say you need to find out what mime 
types GIMP accepts. It should be that easy. I should take some kind image/?? 
mime type. As a failback, it probably accepts a URL, which could point to an 
on-disk copy of the image being dropped. 




----- Original Message ----
From: "Oliver.Knoll at comit.ch" <Oliver.Knoll at comit.ch>
To: qt-interest at trolltech.com
Sent: Tue, February 15, 2011 11:40:29 AM
Subject: [Qt-interest] Windows: Copy from Qt app into GIMP fails?

Hi,

somewhat a special use case, but did anyone ever succeed in copying image data 
from a Qt app into GIMP (www.gimp.org) on Windows?

Windows XP, Qt 4.7.1 MinGW binary distribution.


I have the following code:

QImage image(width, height, QImage::Format_ARGB32); // also tried with 
Format_RGB32, to no avail
...
QClipboard *clipboard = QApplication::clipboard();
QMimeData *mimeData = new QMimeData();
mimeData->setImageData(image);
clipboard->setMimeData(mimeData);

Whenever I try to paste this into Gimp I get the message "The clipboard does not 
contain any data which could be inserted". Copy/paste from my Qt application to 
any other application (MS Word, MS Paint, Paint.Net, LibreOffice, ...) works 
(except that the alpha channel seems to be dropped, but not sure whether that is 
a limitation of the Windows (XP) clipboard...). This somehow tells me that the 
error is more on the GIMP side - but what bugs me is that copy/paste works for 
other non-Qt applications, e.g. Firefox -> Gimp, MS Word -> Gimp, LibreOffice -> 
Gimp, ...

Also the same code above *does work* on Linux and even Mac (where GIMP is 
running with the help of the X11 support).

Anyone has any experience with that?

Thanks, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22

_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest



      



More information about the Qt-interest-old mailing list