PDA

View Full Version : Changing QDrag's pixmap



Gopala Krishna
12th January 2007, 15:58
Hi,
though drag and drop from treeview to QGraphicsScene is working appropriately in my app, I thought of implementing a feature as described below.
What I want to do is change the pixmap of drag object to that of item (Eg. Resistor's pixmap) when the drag enters QGraphicsScene\QGraphicsView.
Is this possible ? If so, can somebody guide me on how can I achieve this ?

Also I would like the item to be added to scene when it is selected in treeview (just by clicking) and then just moving mouse without any button pressed and finally place it at right spot when clicked once more in view. Can this be done using drag and drop mechanism ?
Or is there any better way to do this ?

Bitto
12th January 2007, 19:38
Don't think you can. I may be wrong, but AFAIK, you can only assign a pixmap when starting the drag.

Gopala Krishna
13th January 2007, 05:08
Thanks for the reply Bitto. Now I set the required drag pixmap while initiating drag in treeview itself.
I have one doubt now.
The QDrag's icon or pixmap changes when some widget is able to accept it, like + sign if it accepts. Where is this controlled ? (Just curious ..)