[Qt-interest] How to correctly implement drag and drop?

Jason Wood jason at rtsw.co.uk
Tue Dec 2 10:48:55 CET 2008


Hi,

I have a QTreeView, which is accessing my model (which is derived from 
QAbstractItemModel)

The behaviour that i am trying to get is as follows :

When a drop event occurs that did not start within the tree view, I want it to 
be a copy action event.

When a drop event starts within the tree view, I want it to be a move action 
event.

I have set my model to support both move and copy actions, but whenever I 
start a drag inside of the tree view, it always defaults to being a copy 
action.

Is there a way to set this to be a move action, prefereably without needing to 
subclass the view? 

Cheers,
Jason



More information about the Qt-interest-old mailing list