PDA

View Full Version : drop image fly back



sreedhar
7th March 2006, 15:16
Hi,
I am using Qt4.1.1. I have two widgets that accept drops. I have an image attached to drag.
If a widget does not accept drop then the image must fly to the original point it was dragged from (same as the one seen in browsers, try to drag an image from the browser and drop it on status bar).

Please reply me if this can be done in Qt.

Regards,
Sree

zlatko
7th March 2006, 17:00
Yes this can be done in Qt ;)

sreedhar
7th March 2006, 18:38
Thanks for the reply.
But please do reply me how to do it.

regards,
sree

Chicken Blood Machine
7th March 2006, 21:29
http://doc.trolltech.com/4.1/dnd.html

As for the "flyback" animation, you may have to implement that yourself by showing and moving a transparent widget on a timer.

sreedhar
8th March 2006, 09:11
Thanks for the reply,
But can you provide me an example code of how to do it

regards,
sreed

wysota
8th March 2006, 12:00
Create a widget representing your "icon", create a timer and animate (move) the widget on each timeout. Look at QTimer class docs for details. There are some examples there.