Qiieha
20th June 2011, 09:15
hi
I want to drag a picture to a different application (f.e. gimp). It works fine with that code:
QMimeData* mimedata = new QMimeData;
mimedata->setImageData(QImage("/home/user/picture.jpeg"));
QDrag *drag = new QDrag(this);
drag->setMimeData(mimedata);
QPixmap& pic = *picture;
drag->setPixmap(pic);
drag->exec(Qt::MoveAction);
But there is a problem. The picture is in the application, but it doesn't point to the picture on the file system. It's just a paste command. Does anybody know what I have to do?
thanks
I want to drag a picture to a different application (f.e. gimp). It works fine with that code:
QMimeData* mimedata = new QMimeData;
mimedata->setImageData(QImage("/home/user/picture.jpeg"));
QDrag *drag = new QDrag(this);
drag->setMimeData(mimedata);
QPixmap& pic = *picture;
drag->setPixmap(pic);
drag->exec(Qt::MoveAction);
But there is a problem. The picture is in the application, but it doesn't point to the picture on the file system. It's just a paste command. Does anybody know what I have to do?
thanks