PDA

View Full Version : dragging



mickey
25th July 2006, 12:06
Hi, do anyone know if is possible ( I have 2 widgetGL) drag a .jpg show in wid1 onto wid2?? I'd like see this .jpg moving between two widget while I dragging.....thanks

wysota
25th July 2006, 14:05
Yes, it's possible.

Use QDragObject::setPixmap() to set the drag indicator (your jpeg image) but use QImageDrag instead of QDragObject so that you can use setImage() to set your jpeg image as contents of the drag. Remember to set widgets to accept drops and reimplement proper events (mouse press and mouse move) to start the drag. See docs of d&d for details.